Help! What is wrong with my code?


#1

print '%s/%s/%s, %s:%s:%s' % (now.month, now.day, now.year, now.hour, now.minute, now.second)


#2

According to instructions you should print date and time in mm/dd/yyyy hh:mm:ss format.

You have to delete a comma.

'%s/%s/%s %s:%s:%s'

#3

yep, sounds about right


#4

Can anyone help me find the error in this?

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)

I keep getting a syntax error


#5

no comma after year?


#6

Yes.

According to instructions you should print date and time in mm/dd/yyyy hh:mm:ss format.