Write a python function to check if user provided year is a leap year or not
Topic: Write a python function to check if user provided year is a leap year or not
Solution
def is_leap(year): if (year % 4) == 0: if (year % 100) == 0: if (year % 400) == 0: print(f"{year} is a leap year") else: print(f"{year} is not a leap year") else: print(f"{year} is a leap year") else: print(f"{year} is not a leap year")
List all Python Programs