Leap Year? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Leap Year?

x = int(input()) def leap_year(x): if x % 400 == 0: print("Is big leap year") if x % 100 == 0: print("is not leap year") elif x % 4 == 0: print("Is every 4") leap_year(x) Input: 1990 Output: no output Okay, getting closer. Any idea who to tie the if statements together?

7th May 2019, 7:29 AM
tristach605
tristach605 - avatar
4 Answers
+ 11
#leap.py y=int(input("Enter year:")) if y%4!=0: print("Not a leap year") elif y%100!=0: print("This is a leap year") elif y%400!=0: print("This is not a leap year") else: print("This is a big leap year")
7th May 2019, 7:52 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
0
year = int(input()) #your code goes here if year%400==0: print('This a leap year') elif year%4==0 and year%100!=0: print('This is a leap year') else: print('This is a not a leap year')
30th Nov 2021, 4:29 AM
Cristian Baeza Jimenez
Cristian Baeza Jimenez - avatar
0
year = int(input()) if year % 4 != 0: print("Not a leap year") elif year % 100 != 0: print("Leap year") elif year % 400 ==0: print("Leap year") else: print("Not a leap year")
19th Dec 2021, 2:49 PM
‎باسط احمد‎
0
year = int(input()) if(year%4 == 0): if(year%100 == 0): if(year%400 == 0): print("Leap year") else: print("Not a leap year") else: print("Leap year") else: print ("Not a leap year")
2nd Jan 2022, 7:52 AM
Roaa Qteishat
Roaa Qteishat - avatar