Getting the current Date and Time


#1



https://www.codecademy.com/courses/python-beginner-en-zFPOx/0/2?curriculum_id=4f89dab3d788890003000096#


It says "oops try agian. Did you remember to print the now variable?"


I dont really know what is wrong because I thought I am printing the now variable? What am I doing wrong?


now = datetime.now()
print now


#2

You need to import datetime first just like the example they've provided above the instructions.


#3

Yeah I have that part. It keeps asking me if I remembered to print the now variable. Right now it looks like this

from datetime import datetime
now = datetime.now()
print now


#4

Okay never mind I fixed it. I had to get ride of some stuff that was from the lesson before and it worked fine. Thanks!


#5

Now I'm curious as to why there are stuff from the previous lesson :confused:


#6

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