【发布时间】:2022-12-17 10:49:51
【问题描述】:
我正在尝试使用以下代码解决this question:
is_leap_year = False
not_leap_year = True
input_year = int(input())
if (input_year % 4 == 0 or input_year % 400 == 0):
print(input_year, '- leap year')
elif (input_year % 4 != 0 and input_year % 400 != 0):
print(input_year, '- not a leap year')
为什么我的代码仍然读取 1900 作为闰年?
【问题讨论】:
-
因为 1900 除以 4 的余数为零!
标签: python