Next Leap Year
Write a Python function that calculates the next leap year from the current date.
Explanation of Solution: The function
next_leap_year first gets the current year using
datetime.now().year. It then enters a loop where it checks whether the current year is a leap year. If it is, it returns the year. If it isn’t, it increments the year by 1 and checks again. This continues until a leap year is found.