From e36cc4cc78db88a09d68a5a67cf633668d7c997b Mon Sep 17 00:00:00 2001 From: cramsey Date: Tue, 30 Sep 2025 09:43:14 -0400 Subject: [PATCH] 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) --- ranges.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ranges.py b/ranges.py index 2fa00d7..586c1b6 100644 --- a/ranges.py +++ b/ranges.py @@ -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}")