def myfun(): year=int(input("Enter a year: ")) if(year%400==0)and(year%100==0): print("{0} is a leap year".format(year)) elif(year%4==0 and year%100!=0): print("{0} is a leap year".format(year)) else: print("{0} is not a leap year".format(year)) if __name__=="__main__": myfun()
Enter a year: 2014
2014 is not a leap year
Enter a year: 2024
2024 is a leap year