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 a conditional statement to check if a number is greater than 10.
Use the `if` keyword to start the statement.
How would you use a for loop to print numbers 1 to 3?
Remember that `range` defines the end number as non-inclusive.
What does an if statement do?
Think about the conditions that determine what code is executed.
True or False: A while loop will always execute at least once.
Consider what must happen for the loop to start.
Write a Python program using control structures that allows a user to continue entering numbers until they input a negative number, then outputs the total sum of the entered numbers.
Be careful to only break from the loop when the user enters a negative number.
Create a Python program that generates and displays the multiplication table for a number provided by the user until they choose to stop by entering 'x'.
Make sure to handle the exit condition so the loop can stop gracefully.
6 more questions in this section. Enroll free to practise them all.
Enroll free