<prompt> Create a function to check if a given year is a leap year.  <response>: Sure! Here is a Python function that checks if a given year is a leap year:pythondef is_leap_yearyear: Function to check if a given year is a leap year. if year 400 0: return True if year 100 0: return False if year 4 0: return True return FalseTo use this function, you can call it with a year as the argument, and it will return True if the year is a leap year and False otherwise. For example:pythonis_leap_year2020 Trueis_leap_year2021 FalseThis function works by checking if the year is divisible by 400, 100, or 4, following the rules for leap years. If a year is divisible by 400, it is a leap year. If it is divisible by 100, it is not a leap year, unless it is also divisible by 400. And if it is divisible by 4, it is a leap year, unless it is divisible by 100. These rules ensure that leap years occur every four years, except for years that are divisible by 100 but not 400, which are skipped to keep the calendar in sync with the astronomical seasons. 