Practice - Control Structures
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 a conditional statement to check if a number is greater than 10.
💡 Hint: Use the `if` keyword to start the statement.
How would you use a for loop to print numbers 1 to 3?
💡 Hint: Remember that `range` defines the end number as non-inclusive.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What does an if statement do?
💡 Hint: Think about the conditions that determine what code is executed.
True or False: A while loop will always execute at least once.
💡 Hint: Consider what must happen for the loop to start.
2 more questions available
Challenge Problems
Push your limits with advanced challenges
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.
💡 Hint: 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'.
💡 Hint: Make sure to handle the exit condition so the loop can stop gracefully.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.