Date and Time error


#1

So my instructions are to print the date and time on the same line here is my code:

from datetime import datetime
now = datetime.now()

print '%s/%s/%s , %s:%s:%s' % (now.month , now.day , now.year , now.hour , now.minute, now.second)
the problem is it brings now.second) to a new line cause it doesnt fit. So i get an error syntax. I ran this same program in notepad++ and it worked. help i cant move on without completing it


#2

I don't think it is about that your code goes to the new line, it's probably more about a coma between date and a time in your print statement. Remove it and try again.


#3

still doesnt work man :confused:


#4

Did you removed also one extra blank space between date and time when you removed coma? I've copied your code, removed one space and coma and it worked.


#5