About 1,760,000 results
Open links in new tab
  1. 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.

  2. Leap Year Program in Python using Function - Python Guides

    May 9, 2024 · In this Python tutorial, you learned how to create leap year program in Python using function using the function. You also created a custom function that accepts input from the user and checks whether the given input is a leap year.

  3. Python Program to Check Leap Year

    Source code to check whether a year entered by user is leap year or not in Python programming with output and explanation...

  4. python - How to determine whether a year is a leap year

    Jul 24, 2012 · By definition, a leap year is divisible by four, but not by one hundred, unless it is divisible by four hundred. Here is my code: def leapyr(n): if n%4==0 and n%100!=0: if n%400==0: print(n, "is a leap year.") elif n%4!=0: print(n, "is not a leap year.") print(leapyr(1900))

  5. Python Program For Leap Year (With Code) - Python Mania

    Yes, you can use this Python program for leap year for any year. Simply pass the desired year as an argument to the is_leap_year() function, and it will return True if it is a leap year and False if it is not.

  6. Program to Check Leap Year in Python - ScholarHat

    Jan 19, 2025 · So, in this Python tutorial, we will calculate a leap year using Python, which will contain rules for determining if a year is a leap year, the leap-year program in Python in detail with code examples, and how to check a leap year using macros.

  7. Determine, count, and list leap years in Python | note.nkmk.me

    Jan 31, 2024 · In Python, the calendar module provides functions to determine if a year is a leap year and to count leap years in a specified period. calendar — General calendar-related functions — Python 3.12.1 documentation

  8. Leap Year Program in Python - almabetter.com

    Nov 2, 2024 · Learn how to write a leap year program in Python, logic, and detailed code examples, including functions, user input handling, and the calendar module. A leap year is a year that has 366 days instead of the typical 365, with February 29 being the extra day.

  9. Write a Python Program to Identify Leap Years – TecAdmin

    Apr 26, 2025 · Python, with its readable syntax and powerful libraries, makes implementing this logic straightforward. Here is a simple program that determines whether a given year is a leap year: year = int(input("Enter a year to check: ")) if is_leap_year (year): print(f"{year} is a leap year.") else: print(f"{year} is not a leap year.")

  10. Python Program to Check Leap Year or Not - Tutorial Gateway

    Python Program to Check Leap Year using If Statement. This program allows the user to enter any number and check whether the user entered is a leap year or not using the If statement.

  11. Some results have been removed
Refresh