Core Python Data Structures and Control Flow
Tuple Indexing
Tuples support both forward and reverse indexing:
data = (10, 20, 30, 40, 50)
print(data[0]) # Output: 10
print(data[-1]) # Output: 50
Nested tuples can be accessed using multiple indices:
matrix = ((1, 2, 3), (4, 5, 6))
print(matrix[0][1]) # Output: 2
Iteration
Iterate over sequences using while or for:
values = (5, 10, 15 ...
Posted on Thu, 07 May 2026 11:11:06 +0000 by NerdConcepts
Exception Flow in try-catch Blocks with Return Values
public class DemoApp {
public static void main(String[] args) {
System.out.println("start");
String val = "original";
try {
val = caller(); // remains "original"
} catch (Exception ex) {
ex.printStackTrace();
}
System.out.println(val); // ...
Posted on Thu, 07 May 2026 07:09:14 +0000 by daverico