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 will be printed if age is 20 and we have: 'if age > 18: print("Eligible to vote")'?
Think about what the condition is checking.
In the statement: 'if x < 5: print("Less than 5"); else: print("5 or more")', what will be printed when x is 3?
Consider whether 3 is less than 5.
What keyword is used to create a conditional statement that checks a condition?
Think of which keyword is related to conditions.
True or False: An if statement can exist without an else block.
Remember that optionally you can just check a single condition.
Write a Python program using conditional statements to categorize a number as positive, negative, or zero.
Consider how to assess each category accurately.
Create a program that checks the type of triangle based on the lengths of its three sides.
Think about how to compare the values of the sides.
6 more questions in this section. Enroll free to practise them all.
Enroll free