New to programming and am unsure why I am getting this error
count=int(input ("How many donuts do you have?"))
if count <= 10:
print ("number of donuts: " ) +str(count)
else:
print ("Number of donuts: many")
New to programming and am unsure why I am getting this error
count=int(input ("How many donuts do you have?"))
if count <= 10:
print ("number of donuts: " ) +str(count)
else:
print ("Number of donuts: many")
In python3,
print
is a function that returnsNone
. So, the line:you have
None + str(count)
.What you probably want is to use string formatting:
Your parenthesis is in the wrong spot:
Move it here:
Or just use a comma:
In Python 3 print is no longer a statement. You want to do,
instead of adding to print() return value (which is None)