About 453,000 results
Open links in new tab
  1. How do I solve the leap year function in Python for Hackerrank?

    Jun 8, 2019 · def is_leap(year): leap = False if year % 4 == 0 and (year % 100 != 0 or year % 400 == 0): return not leap else: return leap year = int(input()) print(is_leap(year))

  2. Hackerrank Solution: How to check leap year in Python

    Aug 11, 2022 · Instead of writing the code for leap year manually using the conditions, we can simply use the Python module to check if the given year is a leap year or not as shown below: # importing the module import calendar # function def is_leap(year): leap = False # checking for leap year if calendar.isleap(year): leap = True return leap

  3. Write a function - HackerRank

    Given a year, determine whether it is a leap year. If it is a leap year, return the Boolean True, otherwise return False. Note that the code stub provided reads from STDIN and passes arguments to the is_leap function. It is only necessary to complete the is_leap function.

  4. Write a Function in Python | HackerRank Solution - CodingBroz

    Given a year, determine whether it is a leap year. If it is a leap year, return the Boolean True, otherwise return False. Note that the code stub provided reads from STDIN and passes arguments to the is_leap function.

  5. Check Leap Year Hackerrank Solution - Codersdaily

    Source Task Given a year, determine whether it is a leap year. If it is a leap year, return the Boolean True, otherwise return False. Note that the code stub provided reads from STDIN and passes arguments to the is_leap function.

  6. HackerRank-Solutions/leap_year.py at main · Yozora-7 ... - GitHub

    Given a year, determine whether it is a leap year. If it is a leap year, return the Boolean True, otherwise return False. Note that the code stub provided reads from STDIN and passes arguments to the is_leap function.

  7. HackerRank-Python-Solutions/python_check_leap_year.py at …

    You are given the year, and you have to write a function to check if the year is leap or not. Note that you have to complete the function and remaining code is given as template.

  8. Hackerrank_Python_Solutions/solutions/006_Write_a_function.md ... - GitHub

    In the Gregorian calendar three criteria must be taken into account to identify leap years: The year can be evenly divided by 4, is a leap year, unless: The year can be evenly divided by 100, it is NOT a leap year, unless: The year is also evenly divisible by 400. Then it is a leap year.

  9. HackerRank: Solving Leap Years Puzzle Using Python

    Mar 9, 2022 · So, you might guess you will build an easy algorithm that solve whatever years and determine which is a leap year or not. Congratulation, you’re right! Here’s the puzzle by HackerRank...

  10. Check Leap YearPython | GeeksforGeeks

    Feb 22, 2025 · calendar module in Python provides the calendar.isleap (y) function which checks if a given year is a leap year. This built-in function simplifies leap year validation with a single call returning True or False. Program uses calendar.isleap (y) to check if year is a leap year simplifying logic.

    Missing:

    • HackerRank

    Must include:

Refresh