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.
Use a for loop to print the numbers from 1 to 5.
Use range and start from 1.
Create a while loop that prints 'Hello' five times.
Initialize x to 0 and increment after printing.
What does a for loop do?
Think about what action is performed for every item.
True or False: A while loop will always execute at least once.
Consider what happens if the condition is not satisfied.
Create a program that takes user input for 5 numbers, stores them in a list, and then prints them using a for loop.
Utilize a for loop to gather inputs and another to print them.
Write a program using a while loop that prompts the user to enter a password until they enter the correct one.
Keep asking the user until they get it right.
5 more questions in this section. Enroll free to practise them all.
Enroll free