请告诉我出了什么问题,以及需要改进的其他方式
def finalcalc(y, d, m):
end = (y + d + m) % 7
return end
def monthlook(m):
if m == 1:
monthout = 6
elif m == 2:
monthout = 2
elif m == 3:
monthout = 2
elif m == 4:
monthout = 5
elif m == 5:
monthout = 0
elif m == 6:
monthout = 3
elif m == 7:
monthout = 5
elif m == 8:
monthout = 1
elif m == 9:
monthout = 4
elif m == 10:
monthout = 6
elif m == 11:
monthout = 2
elif m == 12:
monthout = 4
print(finalcalc(yearout, dayout, monthout))
def daysimp(d):
dayout = d % 7
monthlook(monthin)
def yearc(y):
y = y % 100
yearout = y + (y // 4)
yearrem = y % 4
if yearrem >= 2:
yearout += 1
yearout = yearout % 7
daysimp(dayin)
dayin = int(input("What day in the Month?"))
monthin = int(input("What Month Number? - Eg. January is 1"))
yearin = int(input("What Year?"))
yearc(yearin)
错误说:“NameError: name 'yearout' is not defined”- 请给我解决方案和您发现的任何其他问题的答案,以及可以简化和/或改进的方法。