HW #5.py - #Purpose: the user will enter a year in the...

This preview shows page 1 out of 1 page.

The preview shows page 1 - 1 out of 1 page.
#Purpose: the user will enter a year in the format mm/dd/yyyy#Assumption: the program will check the month entered and will check if its aleap year#inputs: int,string#Post-condition: the program will print the actual month and the day and yeardef year():list1 = input("Enter a date using the following format mm/dd/yyyy: ")month = list1[0] + list1[1]day = list1[3] + list1[4]year = eval(list1[6] + list1[7] + list1[8] + list1[9])if month >= "10":month = eval(list1[0] + list1[1])elif month >= "01" and month <= "09":month =eval(list1[1])if day >= "10":day = eval(list1[3] + list1[4])L = dayelif day >= "01" and day <= "09":day = eval(list1[4])L = list1[3] + list1[4]if year >= 1999:if month in range(12 +1):
End of preview. Want to read the entire page?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
professor_unknown
Tags
1920, 1922

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture