If you aren’t familiar with the idea of a leap year, read “Why Is There a Leap Day?” before continuing with the lab.

Your friend is writing a program that will allow the user to input a year and then print “LEAP!” if that year is a leap year or print “not a leap year” if it is not. However, the program isn’t working properly, and your friend asked you for help in debugging.

Before you take a look at the program, you should know these rules for leap years:

A year is a leap year if it can be divided by 400 without a remainder.
A year is a leap year if it can be divided by 4 without a remainder, unless it can also be divided by 100 without a remainder; if that is the case, it is not a leap year.
All other years are not leap years.
Here is your friend’s code:

year=int(input()
if year%400=0:
print("LEAP!")
else:
print(not a leap year")
elseif year%4==0 and year%100!=0
print(“not a leap year")
Note: You may not have seen the % symbol used this way before. It calculates the remainder of the number to the left of it when it is divided by the number to the right of it. So, 10%3 is 1, because when you divide 10 by 3, the remainder is 1.

Respuesta :

The correct debugged code is attached below

What is a leap year

A leap year is a year with 366 days and this year occurs once every 4 years. The debugged code line of code of the program written, is as attached below. because the line of code in the question lacks some functions and symbols

Hence we can conclude that the correct debugged code is attached below.

Learn more about Python coding : https://brainly.com/question/16397886

#SPJ1

Ver imagen batolisis
ACCESS MORE