What to do when month and day are same value?


#1



Date and Time - Hot Date


Despite the fact that I input the correct code, I cannot submit because there is a notification saying the month and day is incorrect.


The module 'datetime' works fine, but seems like the program that accesses the correctness of my answer got it wrong; the day I did this lesson was when the number of month and day was same (November 11).


from datetime import datetime
now = datetime.now()

print '%s-%s-%s' % (now.month, now.day, now.year)


#2

You are supposed to use slashes / ,

'%s/%s/%s'

not dashes ,


#3

Hi @anthropolomon,

your problem doesn't come from the fact that we're 11/11, but from no putting slashes between you're printing values (you wouldn't have any problem if you were not practicing one codecademy platform).

print '%s/%s/%s' %[...]

#4

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