我在python中的year年计划显示错误

时间:2019-04-10 10:37:11

标签: python python-3.x

在没有input()的情况下,我的功能无法正常运行, 但是当我使用input()时,会出现错误。

year = input()
if year%4 == 0:
   if year%100 == 0:
       if year%400 == 0:
           print("year is leap year")
       else:
           print("year is not a leap year")
   else:
       print("year is a leap year")
else:
   print("year is not a leap year")

错误:

Traceback (most recent call last):
  File "leapyear.py", line 2, in <module>
    if year%4 == 0:
TypeError: not all arguments converted during string formatting

0 个答案:

没有答案