Stuck on this date and time example (I am quite new to all of this so I know this is quite trivial)


#1


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


It tells me that I need to look back at my code... overall I just do not understand how to use this function.


Replace this line with your code.


#2

Please, copy and paste your well-formatted code ( use < / > ). The link provided doesn't allow me access your task. :slight_smile:


#3

Getting the Current Date and Time
We can use a function called datetime.now() to retrieve the current date and time.

from datetime import datetime

print datetime.now()
The first line imports the datetime library so that we can use it.

The second line will print out the current date and time.

Instructions
Create a variable called now and store the result of datetime.now() in it.
Then, print the value of now.

this is the instructions provided for me....

1 from datetime import datetime
2
3 now = 6
4 print datetime.now()

error message : Oops, try again. Did you store the result of datetime.now() in the now variable?


#4

So, you're meant to assign datetime.now() to the now variable.

Then, print now.


#5

incredible.... haha.

I appreciate the help, I am still really trying to get used to all of this new lingo!


#6

It's fine.

I'm glad I could help. :slight_smile:

Keep coding!


#7

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