# Initialize the radius as requested
radius = 25
diameter = radius * 2
def draw_circle_row(count, current_row):
# Calculate starting x to center the pyramid
# Move Tracy to the start of the row
x_start = -((count * diameter) / 2) + (current_row * radius)
y_start = -200 + (current_row * diameter)
for i in range(count - current_row):
penup()
setposition(x_start + (i * diameter), y_start)
pendown()
circle(radius)
def draw_pyramid():
# Get user input and convert to integer
row_value = int(input("How many circles on the bottom row? "))
# Use a for loop to draw each row
for i in range(row_value):
draw_circle_row(row_value, i)
# Call the main function
draw_pyramid()