It was difficult to figure out how to write the

for-loop. I mostly figured it out with help. (checkpoint 1)
I understand how to make the ranges well although it did take
a bit to understand completely how to write them. (checkpoint 2)
This commit is contained in:
cramsey
2025-09-30 09:43:14 -04:00
parent fb35c2d456
commit e36cc4cc78

View File

@@ -4,20 +4,23 @@
def print_all_numbers(maximum):
"Prints all integers from 0 to maximum."
for number in range(maximum):
print(number)
for numbers in range(maximum):
print(numbers)
def print_even_numbers(maximum):
"Prints all even integers from 0 to maximum."
pass
for numbers in range(0,maximum,2):
print(numbers)
def print_odd_numbers(maximum):
"Prints all odd integers from 0 to maximum."
pass
for numbers in range(1,maximum,2):
print(numbers)
def print_multiples_of_five(maximum):
"Prints all integers which are multiples of five from 0 to maximum."
pass
for numbers in range(0,maximum,5):
print(numbers)
chosen_maximum = int(input("Choose a number: "))
print(f"All numbers from 0 to {chosen_maximum}")