End of statement expected error

Please when type the below code in pycharm, it gves error.
print “I’m a %s %s and taste %s.” %
error: end of statement expected.

Hi @marketing77,

The three expressions in parentheses that should follow the % operator are missing.

If you are using Python 3, print is a function, and requires parentheses.

Please supply a link to the exercise, so that users are able to supply more specific advice.

1 Like

here is the link to the exercise…

1 Like

Thanks for the link.

Codecademy currently teaches Python 2. If you are porting Codecademy Python code to Python 3, then the print statements need to be updated to enclose the content to be output within parentheses. For example, this …

print "I'm a %s %s and I taste %s." % (self.color, self.name, self.flavor)

… must be updated as follows …

print("I'm a %s %s and I taste %s." % (self.color, self.name, self.flavor))

This …

print "Yep! I'm edible."

… becomes …

print("Yep! I'm edible.")

Be sure to update this line as well …

print "Don't eat me! I am super poisonous."

Thanks,really appreciate the fast help.

1 Like