Why is not working help me


#1

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)

datetime.now()
print(now)


#2

When I copy your code into my lessons I don't have any problems with it at all and it registers no errors. Maybe refresh?


#3

Same problem here, putting the code like this in the editor

from datetime import datetime
now = datetime.now()

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

After clicking "Save and Submit Code" button the console throws back an error message as follows

Traceback (most recent call last):
File "python", line 5, in
ValueError: unsupported format character ':' (0x3a) at index 13

I tried modifying the code by introducing newline character in different way but no solution and the progress is stuck now


#4

Well make sure the mark you are using is in fact a : and not some foreign keyboarding mark that looks like one. Other than that all I can think of to suggest is to refresh browser or maybe try to pass the lesson on another computer.


#5

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