5/6 Pretty Time

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 Likes

Hi instead of / you should use :

5 Likes

It worked! Tks a lot.

from datetime import datetime
now = datetime.now()

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

1 Like

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

1 Like

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

1 Like

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)

1 Like

thx for helping me !

1 Like