tuna = "fish"
if tuna == "fish":
print ' this is fish'
I am getting an invalid syntax error while executing the code. Please correct my code.
tuna = "fish"
if tuna == "fish":
print ' this is fish'
I am getting an invalid syntax error while executing the code. Please correct my code.
In python 3, print
is a function print('hello world')
not a statement as in python 2.x print 'hello world'
, basically you forgot the brackets:
tuna = "fish"
if tuna == "fish":
print('this is fish')
The output would be:
this is fish