subject

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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 06:30
When early motion pictures played in movie theaters, they were often accompanied by live organ or piano music. which of the following are the most likely reasons that this happened? (select all that apply). the music was provided to distract audience members from the loud sounds made when filmstrips were changed. the music accompanied the movies because the movies were silent and audiences were used to hearing music during plays in theaters. the music usually was played before, and sometimes after the movie, as an alternative form of entertainment. the music viewers to interpret the dramatic action in the films.
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
question
Computers and Technology, 24.06.2019 09:00
Why might you chose to crest a function resume
Answers: 1
You know the right answer?
Your friend is writing a program that will allow the user to input a year and then print “LEAP!” if...
Questions
question
Mathematics, 08.03.2021 18:20
question
Mathematics, 08.03.2021 18:20
question
Chemistry, 08.03.2021 18:20