I made a calender to exercise my python skills. I run into an error with this code:
month_status = 1
month_Name = ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "Sebtember", "Oktober", "November", "Desember"]
for month in range(13):
valuen = month+1
print("Now is", valuen , "that is ", month_Name[month])
if valuen == 1:
if month_status == 1:
for f in range(1,29):
print(f)
month_status = 2
else:
for f in range(1,30):
print(f)
month_status = 1
# this elif should be executed first because it has 0 as the first array
elif valuen == 0 or 2 or 4 or 6 or 7 or 9 or 11 :
for i in range(1,32):
print(i)
# and the annoying fact is this second elif would not be executed
elif valuen == 3 or 5 or 8 or 10 :
for i in range(1,31):
print(i)
else:
print("error")
Why does this happen?