Invalid syntax error with pycharm


print '%s/%s/%s' % (, now.month, now.year)
SyntaxError: invalid syntax

Process finished with exit code 1

I try to reviewing with pycharm but error show up. even i copy all code from code in codecademy.
what am i doing resolve it?

from datetime import datetime
now =

print '%s/%s/%s' % (, now.month, now.year)


If your environment is Python 3.x.x then use print() since it is a function.


Thanks! It work after add parenthesis :slight_smile:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.