I am trying out some simple function building in Python, I use Jupyter Qt Console. This is my function:
def fishmarket(price):
print("How much is the fish?")
print("So you say the fish costs" % price "?")
if price > 5:
print("That's too much!")
else: print("That's fine by me")
print("Have a nice day, sir!")
I would like people to call the function and define a price and then get an answer depending on the price. I get a syntax error around the question mark. How do I combine the string and the variable price
in a single printout? I already learned from another answer that % should do the trick with numerical variables, but it didn't help.