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

Nested Decisions

easyIf Statements

📄 Code

Read carefully — what does this print?
1age: int = 17
2has_ticket: bool = True
3if age >= 18:
4 if has_ticket:
5 print('welcome')
6 else:
7 print('buy a ticket')
8else:
9 print('too young')
10print('next')

🎯 Your Answer