Answer to Question #16402 in Python for victor

Question #16402
Write a program that asks the user to enter a year and then tells the user if it a leap year or not. This is not quite as easy as you might think, because the earth does not circle the sun every 365.25. It is actually a bit less than that. So every 100 years we skip one of those leap years. Unfortunately, that actually takes off just a bit too many leap years. So, every 400 years we don’t remove the leap year that we did the previous 3 times the century came around. OK, so now you should be able to write a program that computes leap years for you with the first leap year in 4CE. It you have done it correctly the years 2000, 2004, 2008, 2012, 2016, 2020 will all come out as leap years. But the years 1700, 1800 and 1900 will not come up as leap years.
You are expected to use the ‘and’, ‘or’ and possibly ‘not’ logical operators in your selection routines.
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS