CSCI-UA.0002
Python Assignment 1B
Due: Tuesday, July 14th
Leap Years
PART ONE:
A leap year is a year that is divisible by 4, with the exception of those years which are "century years": 100, 200, ... 1900, 2000, etc. Only those century years which are evenly divisible by 400 are leap years. So, 1900 is not a leap year (even though it is divisible by 4) but 2000 is a leap year.
Write a complete Python program which prompts a user to input a single year, and prints out whether it is a leap year or not. It also verifies that the year is a positive number. If it is negative, the program prints an error message and exits
Notes about your program:
- Make sure your program includes a comment at the beginning with your name along with a brief synopsis of the program.
- You should use comments throughout the source code to explain key steps and calculations.
- Choose intuitive names for variables
- You should use blank lines where appropriate to make your program easy to read.
- Make sure that your program does not contain any syntax errors.
- Test your program to be sure that it runs the way that you expect.
PART TWO:
-
When you are done and have tested it, post your source file "smithjoe_assign1B.py"
to "NYU Classes".