1 answer
(click or scroll down)
for i in range(numFish):
drawFish()
The following examples demonstrate the expected program output.
How many fish? 1
|\
| \
|\ / *\
| | D
|/ \ /
| /
|/
How many fish? 2
|\
| \
|\ / *\
| | D
|/ \ /
| /
|/
|\
| \
|\ / *\
| | D
|/ \ /
| /
|/
Hint: Use a for() loop with a range to iterate numFish times, calling drawFish() inside the loop body.
# student function here
def drawFish():
print(" |\ ")
print(" | \ ")
print("|\ / *\ ")
print("| | D")
print("|/ \ / ")
print(" | / ")
print(" |/ ")
return
#main program code
numFish = int(input("How many fish? "))
drawFish()