Why is line 4 wrong?


#1

from datetime import datetime
now = datetime.now()

print % '%s/%s/%s' (now.year, now.month, now.day)

why is line 4 wrong?


#2

It should be like this:

print "%s %s %s" % (now.year, now.month, now.day)

#3

Thanks. Found an error in the instructions.


#4

The main thing to remember is that the % needs to go after the substitution symbols.