for loop - range (two arguments)
Objective
Introductory Problem
done = False
while not done:
print("Menu")
print("I - Introductory Problem")
print("Q - Quit")
choice = input("Choice: ")
if choice == "I":
print("Introductory Problem")
for x in range(7):
print(x)
elif choice == "Q":
print("Exiting Game!")
done = Truefor loop


Examples
Example 1
Example 1 Output

Example 2
Example 2 Output

Example 3
Example 3 Output

Example 4
Example 4 Output

Combined Examples
Last updated
Was this helpful?