Date and Time


#1

help plez

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

Oops, try again. Your printed date and time do not seem to be in the right format: 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)

https://gyazo.com/4fc17c9829cbe89f85355185cb82b5d1


#2

Your code looks fine but the space between date and time should be reduced. If you observe, your code prints to the console correctly but for an excess space.

See below.

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

#3

oh thank you <3 such a silly mistake... ohwell :slight_smile: thank you for ur time <3


#4

You're welcome.

Have fun coding! :slight_smile:


#5

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