aggiunge esercizio 23
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
def is_year_leap(year):
|
||||||
|
if year % 4 == 0:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
test_data = [1901, 2000, 2016, 1987]
|
||||||
|
|
||||||
|
test_result = [False, True, True, False]
|
||||||
|
|
||||||
|
for i in range(len(test_data)):
|
||||||
|
yr = test_data[i]
|
||||||
|
print(yr, "->", end="")
|
||||||
|
resutl = is_year_leap(yr)
|
||||||
|
|
||||||
|
if resutl == test_result[i]:
|
||||||
|
print("OK")
|
||||||
|
else:
|
||||||
|
print("Failed")
|
||||||
Reference in New Issue
Block a user