Date Time


#1

https://www.codecademy.com/courses/learn-python/lessons/date-and-time/exercises/extracting-information?action=resume_content_item

I had tried the code in the IDLE but it is showing some error like this
Error >> ImportError: cannot import name 'datetime’
Here’s the screenshot of the error


#2

you named your script datetime.py, which means it will look in the script you are currently writing. Not the default datetime.py which ships with python.

if we do:

from math import randint

it will look for math.py. We do not specify the .py at import, but its the file name.


#3

Ya thanks man it worked!!


#4

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