> On Feb 6, 2018, at 13:45, Ken Green <[email protected]> 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 [email protected] _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor
