Please Help, AGAIN


Again, I need help. I tried to follow the instructions but it didn't work out so well.
Here is the code:

from datetime import datetime
now =

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

print mm/dd/yyyy

please let me know where I went wrong:slight_smile:


Assuming you are on Lesson 4:

I'll break down the instructions for you:

Print the current date in the form of mm/dd/yyyy.

They want the STRING in the FORM of mm/dd/yyy. Not literally mm/dd/yyyy. So your string should print the month first, then day, then year like this: "03/29/2017". Hence you don't need that print mm/dd/yyyy in your code (last line).

Change the string so that it uses a / character in between the %s placeholders instead of a - character.

Ok, you've done that.

Re-arrange the parameters to the right of the % operator so that you print now.month, then, then now.year.

Seem like you messed up the order as you are printing now.year, now.month, then BUT they want now.month,, and then now.year to follow the format of mm/dd/yyyy. You are printing a format like yyyy/mm/dd.


Just a little problem, The Sequence.
First month , then day and finally year.

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


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