Hot Date seems not working properly


#1



https://www.codecademy.com/courses/python-beginner-en-zFPOx/0/4


When i use the seemingly correct code i get the following result:

5/<built-in method date of datetime.datetime object at 0x7f608b712f58>/2017
None

For some reason if i submit the solution only replacing the "-" with "/" it works, although the order is still wrong:

from datetime import datetime
now = datetime.now()

print '%s/%s/%s' % (now.year, now.month, now.day)
#This code gets accepted


My proposed solution:

from datetime import datetime
now = datetime.now()

print '%s/%s/%s' % (now.month, now.date, now.year)
#This code throws the above described error

Thanks for your help!


#2

This should be now.day.


#3

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