Nothing is being printed to console


#1



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


from datetime import datetime

now = datetime.now()

print now.year
print now.month
print now.day


#2

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


#3

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


#4

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


#5

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