For the ranges.py submission, it was actually

quite simple to figure out the proper ranges for setting up the python file. I started by copying over the
function from "print_all_numbers" and modified the parameters for each additional function. It was a rare circumstance
where the first try was completely correct.
This commit is contained in:
Justin Toombs 2023-07-25 10:22:31 -04:00
parent 3321e77c06
commit 38e1a0349f
1 changed files with 6 additions and 3 deletions

View File

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