CJCoding With Joseph
15free / daySign inCreate account
← Back to Question List
Python Code Walkthrough #11

Conditional Expression In A Loop

mediumIf Statements

📄 Code

Read carefully — what does this print?
1for num in [3, 10, 7, 12]:
2 label: str = 'big' if num > 8 else 'small'
3 size: int = num * 2 if num < 5 else num
4 print(num, label, size)

🎯 Your Answer