Help with "Getting the Current Date and Time" under Date and Time Lesson


#1


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

Oops, try again. Your code looks a bit off. Check the console window for error messages!

How do i pass this specific lesson? i don't understand the instructions and I don't know how to solve the lesson. It says "Create a variable called now and store the result of datetime.now() in it." so am i suppose to input something into line '1.' after 'from' and 'import' . And if so, what am i suppose to replace both 'datetime' with?

Im very new to world of code. This is my very first course of code ever actually.


 File "python", line 4
    print = now
          ^
SyntaxError: invalid syntax


#2

>>> from datetime import datetime
>>> now = datetime.now()
>>> now
datetime.datetime(2016, 9, 27, 19, 24, 55, 100429)
>>>

#3

Apparently, i somehow had been skipping the "The first line imports the datetime library so that we can use it. The second line will print out the current date and time." note the whole of almost 2 hours staring straight at it.

Thank you some much!


#5

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