Menu

Selection (IF) - Code Quiz

1. What does the following code do?

if temperature > 25: print('Hot') else: print('Not hot')
Prints 'Not hot' all the time
Prints 'Hot' if temperature is greater than 25, otherwise prints 'Not hot'
Prints 'Not hot' if temperature is greater than 25, otherwise prints 'Hot'
Causes an error
Prints 'Hot' all the time

2. What is the output of the following code if 'age' is 18?

if age >= 18: print('Adult') else: print('Child')
Error
No output
Adult
Child

Log in or sign-up to access the quiz



Don't have a login?

You can still revise this topic