21.2.2 - Syntax
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
What is the syntax for an IF statement?
💡 Hint: Recall that it begins with 'if'.
What will this FOR loop output? for i in range(1, 4): print(i)
💡 Hint: Think about how the range function works.
4 more questions available
Interactive Quizzes
Quick quizzes to reinforce your learning
What does the IF statement do in programming?
💡 Hint: Think about decision-making.
A FOR loop is used when:
💡 Hint: Recall the definition of a FOR loop.
3 more questions available
Challenge Problems
Push your limits with advanced challenges
Create a program that utilizes an IF statement and a FOR loop to iterate through a list of numbers and identify which are even or odd.
💡 Hint: Use the modulo operator to determine evenness or oddness.
Write a program using a WHILE loop that will keep asking the user for a password until they enter the correct one.
💡 Hint: Set the condition to continue looping until the correct password is entered.
Get performance evaluation
Reference links
Supplementary resources to enhance your learning experience.