Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is the purpose of an IF statement?
Think about how we decide what to do based on questions.
Write a simple IF statement to check if a number is positive.
Make sure you are checking the number correctly!
What will be printed if age = 15 in the following code? if age >= 18: print('Eligible to vote') else: print('Not eligible to vote')
Remember what the if condition checks for.
In Python, can you have multiple IF statements without chaining them with ELIF?
Think about how we can check things independently.
Write a program that uses nested IF-ELIF-ELSE statements to evaluate a player's score in a game and categorize them as Beginner, Intermediate, Expert, or Pro based on different ranges.
Think about the ranges you want to define for each category.
A theatre group uses conditional statements to decide ticket prices. Write an IF-ELIF-ELSE statement that handles discounts for children, adults, and seniors.
Consider how age impacts ticket pricing and what categories you will use.
5 more questions in this section. Enroll free to practise them all.
Enroll free