Date and Time Python interface


from datetime import datetime
now =

print '%s/%s/%s %s:%s:%s' % (now.month,, now.year, now.hour, now.minute, now.second)
SyntaxError: multiple statements found while compiling a single statement

This is compiling just fine on the website so I tried to practice it some more on the python 3.6.1 shell and I keep getting this error.

Replace this line with your code.


Hello @chrisdlopez,
I think you have tried something like this..

Problem : You can't run more than one statement in a shell.
You should do this..

Go to file menu and and It will show you new file when you click that you will get something like this..

Paste your code there and save it with extension.
To run the file : check in menu and hit run.

Note: python 3.x is different from Python 2.x version,syntax-wise. (here we use Python 2.x)
You need to put braces after print function .. print(something here to print)


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