From 41c7309f4dd1d13cb21aea00e01c811e12e49fd7 Mon Sep 17 00:00:00 2001 From: cdonahue Date: Mon, 29 Sep 2025 09:40:42 -0400 Subject: [PATCH] Checkpont 2; something i understand well is that the ability to find the ranges to count by a certain amount of numers (IE:odd and even) I dont think theres anything about this subject i dont understand, and I feel as if I can do this very well and quick. --- ranges.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ranges.py b/ranges.py index 2fa00d7..9b26cfd 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}")