Question with datetime


from datetime import datetime
now =

print '%s/ %s/ %s' % (now.month,, now.year)

error: Did you remember to print the now variable?

I do not know how to fix this problem?


Hi @yokiaayuxi,

For which one among the six Date and Time exercises did you submit this code?


Getting the Current Date and Time


For the Date and Time 2. Getting the Current Date and Time exercise, instead of this ...

print '%s/ %s/ %s' % (now.month,, now.year)

... just simply display the value of now, as follows ...

print now

Regarding the code that you posted, upcoming exercises will require you to display the various components of the date and the time. For each exercise, the submission correctness test (SCT) will require strict adherence to the format specified in the instructions. For example, no spaces should be included in the output that are not called for in the specifications.


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