Generation

generate functionSun, 13 Nov 2022

Ask user to input a data in the form YYYY and check if it is a leap year. If it is, print leap year, if not then output it is not a leap year.

def check_leap_year(year): if year % 4 == 0: if year % 100 == 0: if year % 400 == 0: return 'leap year' return 'not a leap year' return 'leap year' return 'not a leap year' print(check_leap_year(2000))

Questions about programming?Chat with your personal AI assistant