Q. Write a program to take year as input and check if it is leap year or not.


You can understand by Watching video :-



Answer :-

year = int(input("Enter year = "))
print((year % 4 == 0  and "it is leap year ")or "it is not leap year")

Output :-

Enter year = 2020
it is leap year

>>> 

Enter year = 2022
it is not leap year

>>> 

Enter year = 2016
it is leap year

>>>

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post