0
Hey guys need help understanding the Leap year exercise
year = int(input()) if year % 4 != 0: print("Not a leap year") elif year % 100 != 0: print("leap year") elif year % 400 != 0: print("Not a leap year") else: print("Not a leap year") Where am i wrong?
4 ответов
0
https://www.sololearn.com/Discuss/2710373/?ref=app
0
There are times when using a function makes things much neater:
https://code.sololearn.com/ca25a6a3a8A4
0
What about replacing the second block with this:
elif year % 100 == 0:
print("Not a leap year")
and replacing else block with this:
else:
print("Leap year")