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 is the syntax for an IF statement?
Recall that it begins with 'if'.
What will this FOR loop output? for i in range(1, 4): print(i)
Think about how the range function works.
What does the IF statement do in programming?
Think about decision-making.
A FOR loop is used when:
Recall the definition of a FOR loop.
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.
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.
Set the condition to continue looping until the correct password is entered.
7 more questions in this section. Enroll free to practise them all.
Enroll free