- 1

Write the program plz i m getting bug for this hlp me

You need to make a program to take a year as input and output "Leap year" if it’s a leap year, and "Not a leap year", if it’s not. To check whether a year is a leap year or not, you need to check the following: 1) If the year is evenly divisible by 4, go to step 2. Otherwise, the year is NOT leap year. 2) If the year is evenly divisible by 100, go to step 3. Otherwise, the year is a leap year. 3) If the year is evenly divisible by 400, the year is a leap year. Otherwise, it is not a leap year. Sample Input 2000 Sample Output Leap year Use the modulo operator % to check if the year is evenly divisible by a number.

17th Feb 2021, 2:02 PM
Gayathri Uppada
7 Antworten
17th Feb 2021, 2:16 PM
R🍁🇮🇳
R🍁🇮🇳 - avatar
+ 3
Seems do be a duplicate... https://www.sololearn.com/Discuss/2699475/?ref=app Please delete the other because it's same as this (only with less info).
17th Feb 2021, 2:17 PM
Matthew
Matthew - avatar
+ 2
Gayathri Uppada Show your attempt
17th Feb 2021, 2:06 PM
R🍁🇮🇳
R🍁🇮🇳 - avatar
+ 1
year = int(input()) #your code goes here 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")
7th Nov 2021, 8:57 AM
Chen qian
Chen qian - avatar
0
plz go n run the program i dt understand where the bug year = int(input()) if year%4==0: print("Leap year") else: if year%100==0: print("Not a leap year") else: if year%400==0: print("Leap year") else: print("Not a leap year")
17th Feb 2021, 2:08 PM
Gayathri Uppada
0
Some logic missing .. i think if year%4==0 and not year%100==0 If it year%100==0 then must be year%400==0 : In other cases, it must not a leap year...
18th Feb 2021, 10:37 AM
Jayakrishna 🇮🇳