I'm trying to print the solution of the following python function using command prompt but getting an error. I'm not sure whether the command which I am giving is wrong or there is any mistake in the code itself. Can you please check?
# A. donuts
# Given an int count of a number of donuts, return a string
# of the form 'Number of donuts: <count>', where <count> is the number
# passed in. However, if the count is 10 or more, then use the word 'many'
# instead of the actual count.
# So donuts(5) returns 'Number of donuts: 5'
# and donuts(23) returns 'Number of donuts: many'
def donuts(count):
if count < 10:
return 'Number of dounts:' + str(count)
else:
return 'Number of donuts: many'
I gave the following command in the command prompt
C:\>PythonCourse\google-python-exercises\basic\string1 donuts('10')
Getting the following error:
File "C:\PythonCourse\google-python-exercises\basic\string1.py", line 77
print '%s got: %s expected: %s' % (prefix, repr(got), repr(expected))
SyntaxError: invalid syntax
I tried running the solution file as well but I get the same error. I'm new to python, any help would be appreciated. I'm using python 3.8. Please let me know if I should provide any other details.