#test if a year is a leap year. # returns True if arg is a leap year, #returns False if arg is not leap year #convention to name boolean functions is_... def is_leapyear (year): # evenly divisible by 4 but not by 100 unless also by 400 if year%4==0 and year%100!=0 or year%400==0: return True else: return False year = int(input("Enter a year: ")) # different variable than function's parameter if is_leapyear(year): print("Olympics and presidential election year") else: print("No Feb 29 this year")