Date and Time Grand Finale Issues


#1

Hi,
I'm on the Finale for date and time, but my code is acting funny, and it's saying the date and time aren't in the mm/dd/yyyy hh:mm:ss order, when they are.

I expected it to accept it, but nope
Anyways, can you tell me what I'm doing wrong? Thanks!

from datetime import datetime
now = datetime.now()

print "mm/dd/yyyy hh:mm:ss"
print '%s/ %s /%s' % (now.month, now.day, now.year)
print '%s: %s: %s' % (now.hour, now.minute, now.second)


#2

So your print statement is off. I think you just got confused on how it was asking you to print this. Remember how you printed each line seperately?

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

Now you just have to print it all together in one print statement! So combine the two %s parts and the two (now.time) statements. Keep them in the order you first printed them. Also, make sure to watch your spacing and punctuation when combing.


#3

Thanks a ton! I'll keep that in mind!


#4

No problem and glad to help! If you have anymore problems with it just let me know!


#5

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