Python Date and Time FInal Chapter


#1


https://www.codecademy.com/courses/python-beginner-en-zFPOx/0/6?curriculum_id=4f89dab3d788890003000096#

No error messages presented

Date and time are mentioned in the required style
But cannot proceed with code
There may be a serious bug issue

Replace this line with your code. Do not remove the backticks that are above or below this line.


#2

from datetime import datetime
now = datetime.now()

print '%s/%s/%s %s:%s:%s' % (now. month, now.day, now.year, now.hour, now.minute, now.second)


#3

i get the exact same error, seems someone needs to do some debugging--

Print the date and time together in the form: mm/dd/yyyy hh:mm:ss.

from datetime import datetime
now = datetime.now()

print '%s/%s/%s %s:%s:%s' % (now.month, now.day, now.year, now.hour, now.minute, now.second)

3/4/2017 19:41:12

ohh wow that's weird... after 5 times refresh it finally worked :frowning:


#4

File "python", line 3
print '%s/%s/%s' (now.month, now.day, now.year) print '%s:%s:%s' (now.hour, now.minute, now.second)
^
SyntaxError: invalid syntax


#5

from datetime import datetime
now = datetime.now()

print '%s/%s/%s %s:%s:%s' % (now.month, now.day, now.year, now.hour, now.minute, now.second)