From 3bd928ca293b945dd66b5dd88056cdc869883658 Mon Sep 17 00:00:00 2001 From: mollychi Date: Sun, 14 Sep 2025 21:21:29 -0400 Subject: [PATCH] I added the for number in range to all the other functions, added a starting value to the 3 broken functions, and a skip counting value to all the broken functions. Something i understood well was the idea that i needed to use the same "for number in range" prompt for all of the functions. Something I was unsure about was why my even numbers wouldnt work when i had (max, 2), but i realized the error of not having a strting value. Other than that theres not much i was unsure about as this is very similar to math. --- ranges.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ranges.py b/ranges.py index 2fa00d7..6b915c9 100644 --- a/ranges.py +++ b/ranges.py @@ -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(0, maximum, 5): + print(number) chosen_maximum = int(input("Choose a number: ")) print(f"All numbers from 0 to {chosen_maximum}")