We use an indefinite while loop to keep the user entering a string. In the loop, we use if-else structure to check the string. If it is "duck", we increment the count by 1. If it is "goose", we stop the loop using a break.
Comments are used to explain each line of the code.
You may see the output in the attachment.
#variable to count the number of duck string entered
count = 0
#create an indefinite while loop. In the loop,
# if the bird is duck, increment the count by 1
# if the bird is goose stop the loop
while True:
bird = input()
if bird == "duck":
count += 1
elif bird == "goose":
break
#print the count
print("Number of duck(s)", count)
Here is another question related to the loops:
https://brainly.com/question/13642794