+ 1

# Can u find the bug ? Plz run the code in else statement leap year program plz.

year = int(input()) if year%4!=0: print("Not a leap year") elif year%100!=0: print("Not a Leap year") elif year%400==0: print("Leap year") else: print("Not a leap year")

5 Answers

+ 3

Mohammad Saad not every year that gets divided by 4 is a leap year.

+ 3

Mohammad Saad year 1700,1800 and 1900 aren't leap year but 4 divides each of them

+ 1

Edited
year=int(input())
if(year%4==0 and year%100!=0 or year%400==0):
print(leap year")
else:
print("Not a leap year ")
https://code.sololearn.com/cLCzB08UTSQq/?ref=app

+ 1

Abhay Bro can you explain how ?pls give some example

+ 1

I dont know about it thanks bro
year=int(input())
if(year%4==0 and year%100!=0 or year%400==0):
print("leap year ")
else:
print("not a leap year ")
#Use this code