Nothing is being printed to console


I keep getting the error message
File "python", line 4
print now.year
SyntaxError: invalid syntax

from datetime import datetime

now =

print now.year
print now.month


what did you do? i retyped now.year and it worked fine


I already had the first chunk of code, and all I wrote was the last three lines that should have printed, yet it kept telling me that it was invalid syntax


can i see an updated version of your code? Maybe copy my now.year? It could be (if you have a different language keyboard), not the right character is used


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