On 02/06/2018 03:20 PM, David Rock wrote:
On Feb 6, 2018, at 13:45, Ken Green <beachkid...@gmail.com> wrote:
Traceback (most recent call last):
   File "A_Weekday.py", line 20, in <module>
     answer = datetime.date(year, month, day).weekday()
NameError: name 'datetime' is not defined
Your error message tells you the problem.  You are importing date _from_ 
datetime, but then try to call datetime.date

from datetime import date
You have _not_ imported date time, so the program doesn’t know what you mean 
when you say

answer = datetime.date(year, month, day).weekday()

Try just doing

import datetime

instead.


—
David Rock
da...@graniteweb.com


Thank you, sir. You put me on the right path. Much appreciated.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to