I added loops that were similar to the given ex.

Checkpoint 1:
- It wasn't really difficult. I initially wrote the
loop based on the number of sides the square has
but then noticed the input was size dependent and
not shape. So I just used the number of inputs for
the loop.

Checkpoint 2:
- I think the concept of range and the related
function we use is pretty simple and I understood
it pretty well overall.
- My mind briefly wandered off to series while
writing the odd function. I could probably figure
out why that connection popped up in my mind and
how to implement it if asked but it wasn't needed
for this time.

Checkpoint 3:
- I definitely will utilize docstrings along with
whitespaces to help making the code more legible
and easier to follow. This doesn't only benefit
people who are unfamiliar with my code but also
it benefits me to keep track of my thoughts if I
ever were to take a break from, or foresee editing
my code.
This commit is contained in:
caglazir
2025-09-12 20:42:21 -04:00
parent d24459b5a9
commit 84f216674a
2 changed files with 9 additions and 13 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(0,maximum,5):
print(number)
chosen_maximum = int(input("Choose a number: "))
print(f"All numbers from 0 to {chosen_maximum}")