diff --git a/lab23.py b/lab23.py new file mode 100644 index 0000000..5fbb60d --- /dev/null +++ b/lab23.py @@ -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") \ No newline at end of file