Control flow
if / elif / else
Python checks each condition from top to bottom and runs only the first block whose condition is true. Order matters: if you checked marks >= 60 first, a score of 95 would get "First class".
Indentation is syntax. Python uses 4 spaces, not {} braces, to decide which lines belong inside the if. A missing or extra space is an IndentationError. VS Code inserts the spaces for you when you press Tab.
Truthiness. Empty values count as false: "", 0, [], {}, None. So if expenses: means "if the list isn't empty".
for loops: repeat for each item
while loops: repeat until something changes
while True + break is the standard pattern for menus, and it's exactly how your expense tracker's main loop works. If you create an infinite loop by mistake, press Ctrl+C.
Worked example: FizzBuzz
This is the most famous screening problem. Print 1 to 15, but print "Fizz" for multiples of 3, "Buzz" for multiples of 5, and "FizzBuzz" for multiples of both.
Why check 15 first? Because 15 is also divisible by 3, so the n % 3 branch would catch it and print "Fizz".