updated ranges to work!

This commit is contained in:
jandrews
2025-10-01 10:16:30 -04:00
parent b4ed8cd43c
commit 5d186c6ec6
2 changed files with 10 additions and 4 deletions

View File

@@ -9,15 +9,18 @@ def print_all_numbers(maximum):
def print_even_numbers(maximum): def print_even_numbers(maximum):
"Prints all even integers from 0 to maximum." "Prints all even integers from 0 to maximum."
pass for number in range(0,maximum,2):
print(number)
def print_odd_numbers(maximum): def print_odd_numbers(maximum):
"Prints all odd integers from 0 to 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): def print_multiples_of_five(maximum):
"Prints all integers which are multiples of five from 0 to 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: ")) chosen_maximum = int(input("Choose a number: "))
print(f"All numbers from 0 to {chosen_maximum}") print(f"All numbers from 0 to {chosen_maximum}")

View File

@@ -12,6 +12,9 @@ def square(side_length):
sizes = [20, 40, 60, 80, 100] sizes = [20, 40, 60, 80, 100]
for size in sizes: for size in sizes:
square(size) square(20)
penup()
forward(40)
pendown()
input() input()