My code from the data/time module on Codeacademy...can't get past this one section called "Hot Date" =========== from datetime import datetime now = datetime.now() print now year = str(now.year) month = str(now.month) day = str(now.day) print str(month), "/" + str(day), "/" + str(year) ================ it prints out this 2013-11-02 14:06:22.683693 11 /2 /2013 None ================= Yet, Codeacademy won't let me get past this exercise Oops, try again! Your printed date doesn't seem to be in the proper format: mm/dd/yyyy ================= Any ideas?
Not sure why you are getting spaces. What I had done: ``` from datetime import datetime now = datetime.now() print now current_year = now.year m=now.month d=now.day bla= str(m)+'/'+str(d)+'/'+str(current_year) print bla ``` Same basic stuff. Order of doing a few things is different, but nothing major. Not sure ehy mine works and not yours.
Thanks...you actually figured it out for me. I was using the commas as in the example. I removed the comma after the str(month)...etc. and replaced it with the +. It works now. Thanks for getting me on the right track.
Ah! I missed seeing those. I was looking at the + and wondering how you got spaces.
Join our real-time social learning platform and learn together with your friends!