Computer Science - Text-Based Programming - Python - Conditionals (if-elif-else) - Trace the Conditionals
8 code tracing questions. Q1: x=15; if x>10: print('A') elif x>5: print('B') else: print('C') → 'A' (first match wins, doesn't check elif). Q2: x=7; if x>10: print('big') if x>5: print('medium') if x>0: print('small') → 'medium' then 'small' (separate ifs, not elif!). Q3: a=3; b=5; if a>b: print(a)