3. Check whether entered year is leap year or not.
‼️‼️write a python program‼️‼️
Answers
Answered by
6
Answer:
year = int(input("Enter year to check: "))
if year % 400 == 0:
print("It's a leap year")
else:
print("It's not a leap year")
Hope it helps!!
Have a great day!!
Answered by
3
is_leap = lambda year: (((year % 4 == 0) and (year % 100 != 0)) or (year % 400 == 0))
if is_leap((year := int(input("year: ")))):
print("Leap year! :-D")
else:
print("Not a leap year. :'(")
Similar questions