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 the following code output?
age = 20
if age >= 18:
print('Eligible')
else:
print('Not Eligible')Check if age is 18 or older.
Write an IF statement that checks if the number is positive.
Think about using the greater than operator.
What does an IF statement do?
Think about what makes the IF statement distinct.
True or False: The ELSE statement only executes if the IF condition is true.
Reflect on what the purpose of ELSE is.
Create a nested IF statement that checks whether a user can attend college based on both their age and their high school diploma status. Write the conditional structure.
Consider how you can check two separate conditions effectively.
Write a program that continuously prompts for a user’s age until they provide a correct response (18 or older) and informs them of their eligibility to vote.
Think about how to use a loop to keep asking.
5 more questions in this section. Enroll free to practise them all.
Enroll free