From 38e1a0349f6a85ceecbd42141ae07c928bf6f204 Mon Sep 17 00:00:00 2001 From: Justin Toombs Date: Tue, 25 Jul 2023 10:22:31 -0400 Subject: [PATCH] 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. --- ranges.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ranges.py b/ranges.py index 2fa00d7..715f553 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(5, maximum, 5): + print(number) chosen_maximum = int(input("Choose a number: ")) print(f"All numbers from 0 to {chosen_maximum}")