14 lines
280 B
Python
14 lines
280 B
Python
# Basic example of a while loop
|
|
|
|
# While loops "do something" as long as the condition
|
|
# defined at the start of the loop is True
|
|
|
|
print("Here are the numbers from 1 to 10...")
|
|
print()
|
|
|
|
number = 1
|
|
while number <= 10:
|
|
print(f"Number: {number}")
|
|
number = number + 1
|
|
|
|
print() |