unix - Python print in terminal returning 'invalid syntax' -


im using terminal on mac run python , when try print string invalid syntax error.

michaels-mbp:~ mike$ python text.py file "text.py", line 2 print(‘hi’)       ^ syntaxerror: invalid syntax 

i've tried single quotes , , without parentheses keep getting error, wrong.

should be:

print('hi') 

you have proper british quotes ‘foo’. right symbols use when writing human-readable texts, python wants actual single quotes '.

your editor has kind of smart-quotes feature enabled, wise turn off when writing code (e.g. configure editor detect extensions .py).


Comments