I need to figure out how to get this program to run using Py

I need to figure out how to get this program to run using Python. I am working in Daniel Liang\'s Introduction to Programming using Python. The exercise states:
\"Write a program that prompts the user to enter the month and year and displays the number of days in the month. For example, if the user entered the month 2 and year 2000, the program should display that February 2000 has 29 days. If the user entered 3 and year 2005, the program should display that March 2005 has 31 days.\"

Solution

days_in_month_dict = {\"January\": 31, \"February\": 28, \"March\": 31, \"April\": 30, \"May\": 31, \"June\": 30, \"July\": 31, \"August\": 31, \"September\": 30, \"October\": 31, \"November\": 30, \"December\": 31} def is_leap_year(year): return (year % 4 == 0) and (year % 100 != 0) or (year % 400 == 0) def days_in_month(year, month): if is_leap_year(year) and month == \"February\": return 28 try: #attempt to get value from dictionary return days_in_month_dict[month] except KeyError: #key does not exist, so we caught the error return None
I need to figure out how to get this program to run using Python. I am working in Daniel Liang\'s Introduction to Programming using Python. The exercise states:

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site