Ask Question

A leap year in the Gregorian calendar system is a year that's divisible by 4 but not by 100, unless it is also divisible by 400. For example, 1896, 1904, and 2000 were leap years but 1900 was not. Write a function that takes in a year as input and prints whether it's a leap year (or not). In the program, ask the user to input a year and then call the function to determine whether the input year is a leap year or not. Display the result to the user.

+2
Answers (1)
  1. 4 December, 22:15
    0
    def leap_year (year):

    return int (year) % 4 = = 0 and (int (year) % 100! = 0 or int (year) % 400 = = 0)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “A leap year in the Gregorian calendar system is a year that's divisible by 4 but not by 100, unless it is also divisible by 400. For ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers