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.
Something is wrong with the compiler for this question. The test case for 1992 is not returning the same output when I Run Test with Custom Input vs Submit Code. I ran my code locally on my computer and 1992 returns FALSE since it is not a leap year. When I run the same code on the compiler it returns TRUE:
def is_leap(year):
leap = False
# Write your logic here
if year % 4 == 0:
if (year % 100 == 0) and (year % 400 == 0):
leap = True
return leap
year = int(input())
print(is_leap(year))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Join us
Create a HackerRank account
Be part of a 26 million-strong community of developers
Please signup or login in order to view this challenge
Write a function
You are viewing a single comment's thread. Return to all comments →
Something is wrong with the compiler for this question. The test case for 1992 is not returning the same output when I Run Test with Custom Input vs Submit Code. I ran my code locally on my computer and 1992 returns FALSE since it is not a leap year. When I run the same code on the compiler it returns TRUE: def is_leap(year): leap = False
year = int(input()) print(is_leap(year))