Question: 1!.# Valid_Month function as shown below. It accepts one string parameter and returns a boolean (True or False). from datetime import * def Valid_Month(newMonth): if
1!.# Valid_Month function as shown below. It accepts one string parameter and returns a boolean (True or False).
from datetime import *
def Valid_Month(newMonth):
if not newMonth.isdigit():
return False if
int(newMonth) < 0 or int(newMonth) > 12:
return False
return True
def main( ):
a = input("Enter the month 1-12: ") while not Valid_Month(a):
print ("Error -- please enter a valid month 1-12")
a = input("Enter the month: ")
main()
2.% Create another function called Valid_Year like the example above which accepts one string parameter and RETURNS a boolean (True or False). No input or print functions in this. HINT: import a module called datetime and use the constants MAXYEAR and MINYEAR
# 3: Following the example shown above, create another function called Valid_Day which accepts (one string and two integers (stringDay, integerMonth, integerYear) and RETURNS a boolean (True or False). NOT be ANY input or print statements in the function? > use the module calendar and use the method monthrange() method
@!4.: Write a program that imports your module (modVerifyDates.py) and does the following: from modVerifyDates import * Reads date information from a text file Be sure to ask the user to enter the file name and end the program if the file doesnt exist. Text file format will be similar to the information shown below:
12-31-2020
12-32-2020
1a-30-2020
12-?0-2020
12-30-99999
12-30--209
2-29-2020
2-29-2021
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
