Message269183
I don't know why but whenever I try and run this code:
import calendar
import time
calendar = calendar.month(2016,6)
print ("Loading date, time, month and leap year status")
time.sleep(5)
print (calendar)
localtime = time.asctime(time.localtime(time.time()))
print (localtime)
if calendar.isleap(2016) == True:
print("This year is a leap year")
else:
print("This year is not a leap year")
It come up with:
Loading date, time, month and leap year status
June 2016
Mo Tu We Th Fr Sa Su
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
Fri Jun 24 15:46:12 2016
Traceback (most recent call last):
File "C:\Users\Dylan\Desktop\Python\Calendar.py", line 9, in <module>
if calendar.isleap(2016) == True:
AttributeError: 'str' object has no attribute 'isleap'
And I don't know why I keep getting error messages |
|
Date |
User |
Action |
Args |
2016-06-24 14:52:56 | Dyl Tuckey | set | recipients:
+ Dyl Tuckey |
2016-06-24 14:52:56 | Dyl Tuckey | set | messageid: <1466779976.93.0.849803568402.issue27382@psf.upfronthosting.co.za> |
2016-06-24 14:52:56 | Dyl Tuckey | link | issue27382 messages |
2016-06-24 14:52:56 | Dyl Tuckey | create | |
|