We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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)".
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Write a function
You are viewing a single comment's thread. Return to all comments →
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)".