5/6 Pretty Time


#1

Can someone help me? Tks.

from datetime import datetime
now = datetime.now()

print '%s/%s/%s' % (now.hour, now.minute, now.second)

They keep saying, 'Oops, try again. It looks like your printed time is not in the proper format: hh:mm:ss'


#2

Hi instead of / you should use :


#3

It worked! Tks a lot.

from datetime import datetime
now = datetime.now()

print '%s:%s:%s' % (now.hour, now.minute, now.second)


#4

it should be print '%s:%s:%s' %(now.hour,now.minute,now.second)


#5

Um . . . is there any difference between yr code and mine?


#6

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


#7

thx for helping me !