Python 3.7.4:
Write a loop that reads strings from standard input, where the string is either "duck" or "goose".
The loop terminates when "goose" is read in.
After the loop, your code should print out the number of "duck" strings that were read.
-----------------
This is what I tried so far, and it's been marked wrong by MyProgrammingLab:
count = 0inputstring=input("Enter goose/duck: ")countducks=0while inputstring!="duck": countducks+=1 inputstring=input("Enter either the word goose or duck: ")print(countducks, "This is the number of times duck was entered:" count)
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here