Oct 5, 2024
putBall
100 times), use a for loop to simplify the process.for i in range(n):
where n
is the number of times to repeat.for i in range(10): putBall()
repeats putBall()
10 times.range()
to adjust repetitions (e.g., 100 times).move
repeatedly, use a loop:
for i in range(9):
move()
range()
allows Carol to move the desired number of times.move()
is outside the loop to see the placed tennis balls:
for i in range(10):
putBall()
move() # This moves Carol off the spot after placing balls
range(100)
to place 100 tennis balls.