Advertisements
Advertisements
Question
Write a Python code to check whether a given year is a leap year or not.
Advertisements
Solution
n = int (input(“Enter any year”))
if (n % 4 = = 0):
print “Leap year”
else:
print “Not a Leap year”
Output:
Enter any year 2001
Not a Leap year
APPEARS IN
RELATED QUESTIONS
A Function which calls itself is called as ______
Which function is called anonymous un-named function?
While defining a function which of the following symbol is used.
Pick the correct one to execute the given statement successfully.
if ______ : print(x, " is a leap year")
How to set the limit for recursive function? Give an example.
Write a Python code to find the L.C.M. of two numbers.
Explain the following built-in function.
chr()
Explain the following built-in function.
round()
Explain the following built-in function.
type()
Explain the following built-in function.
pow()
