• + 1 comment

    as 3 condition are mentioned in question so we put that part in if condtion and here the required output is shown in boolean so i set leap=True and leap= False and wrote the condition in reture. now when you execute the program and give the input, it will print the function and in function the whole logic will execute if the three conditon matches it will return the leap in form of True and False.

    Note:- You can write "return leap" instead of "return ((year%4==0 and year%100!=0) or year%400==0)".