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.
Create a while loop that prints numbers from 1 to 3.
Ensure you start counting at 1 and know when to stop.
Write a while loop that prints 'Hello!' three times.
Track how many times you've printed 'Hello!'.
What keyword is used to create a while loop in Python?
Think about which keyword indicates a repeating condition.
True or False: A while loop can lead to an infinite loop if the condition is never updated.
Consider what happens if we forget to adjust the condition.
Write a program that simulates a simple ATM that allows the user to withdraw money until they choose to exit by entering 'exit'.
Track the user's actions properly, and remember to check their balance after each transaction.
Create a program that continually asks for a password until the user enters 'Python123'. Provide feedback for wrong entries.
Ensure to give feedback on what the user input was if incorrect.
5 more questions in this section. Enroll free to practise them all.
Enroll free