12 lines
337 B
Python
12 lines
337 B
Python
# Question: Write a Python program to check whether a given year is a leap year or not.
|
|
|
|
def main(year: int) -> None:
|
|
if (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0):
|
|
print(f"{year} is a leap year.")
|
|
else:
|
|
print(f"{year} is not a leap year.")
|
|
|
|
if __name__ == '__main__':
|
|
main(2020)
|
|
main(2021)
|