Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
Write an if statement to check if a person is eligible to drive at the age of 16.
Think about the age limit for driving.
Using an if statement, print 'Hello' if the user name is 'Alice'.
You will need an equality check with '=='
What does the if statement do?
Remember the basic syntax of the if statement.
True or False: The else statement is executed when its corresponding if condition is true.
Think about when the else block activates.
Create a Python program that asks the user for a temperature in degrees Celsius. If the temperature is below 0, print 'Freezing'. If it's between 0 and 30, print 'Normal'. If it's above 30, print 'Hot'.
Think about the ranges and structure your if-elif-else based on those.
Design a program that asks a user to input their age and suggests whether they can enter a club (18+). Additionally, if the user is under 12, suggest other activities.
Use multiple pathways to guide the user appropriately.
5 more questions in this section. Enroll free to practise them all.
Enroll free