Practice - if Statement
Enroll to start learning
You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.
Practice Questions
Test your understanding with targeted questions
Write an if statement to check if a person is eligible to drive at the age of 16.
💡 Hint: Think about the age limit for driving.
Using an if statement, print 'Hello' if the user name is 'Alice'.
💡 Hint: You will need an equality check with '=='
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What does the if statement do?
💡 Hint: Remember the basic syntax of the if statement.
True or False: The else statement is executed when its corresponding if condition is true.
💡 Hint: Think about when the else block activates.
1 more question available
Challenge Problems
Push your limits with advanced challenges
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'.
💡 Hint: 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.
💡 Hint: Use multiple pathways to guide the user appropriately.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.