Computers and Technology

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")

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 21:00, shawnnoteman1234
Which task uses a simple parameter?
Answers: 1
image
Computers and Technology, 24.06.2019 17:00, 322993
Following are uses of spreadsheets. for each use, choose whether the use is a business use, consumer use, or student use. family budget: sales data: recording research data for science class:
Answers: 2
image
Computers and Technology, 25.06.2019 02:00, Aaraar
Feedback is one of the basic elements games have in common true false
Answers: 2
image
Computers and Technology, 25.06.2019 06:20, joe7977
If you want to change the speed of a layer's horizontal scrolling, what should you change? a. the x coefficient b. the y coefficient c. the virtual width d. the order of the game's layers select the best answer from the choices provided
Answers: 2
Do you know the correct answer?
Your friend is writing a program that will allow the user to input a year and then print “LEAP!” if...

Questions in other subjects: