Instructions Write a function is_valid_month(date_list) that takes as a parameter a list of strings in the [MM, DD, YYYY] format and returns True if the provided month number is a possible month in the U.S. (i.e., an integer between 1 and 12 inclusive). Write a function is_valid_day (date_list) that takes as a parameter a list of strings in the [MM, DD, YYYY] format and returns True if the provided day is a possible day for the given month. You can use the provided dictionary. Note that you should call is_valid_month() within this function to help you validate the month. Write a function is_valid_year (date_list) that takes as a parameter a list of strings in the [MM, DD, YYYY] format and returns True if the provided year is a possible year: a positive integer. For the purposes of this lab, ensure that the year is also greater than 1000. Test Your Code #test incorrect types assert is_valid_month([12, 31, 2021]) == False assert is_valid_day ([12, 31, 2021]) == False assert is_valid_year ([12, 31, 2021]) == False Make sure that the input is of the correct type assert is_valid_month(["01", "01", "1970"]) == True assert is_valid_month(["12", "31", "2021"]) == True assert is_valid_day (["02", "03", "2000"]) == True assert is_valid_day (["12", "31", "2021"])== True assert is_valid_year (["10", "15", "2022"]) == True assert is_valid_year (["12", "31", "2021"]) == True Now, test the edge cases of the values: assert is_valid_month(["21", "01", "1970"]) == False assert is_valid_month(["-2", "31", "2021"]) == False assert is_valid_month(["March", "31", "2021"]) == False assert is_valid_day (["02", "33", "2000"]) == False assert is_valid_day (["02", "31", "2021"]) == False assert is_valid_day (["02", "1st", "2021"]) False assert is_valid_day (["14", "1st", "2021"]) == False assert is_valid_year (["10", "15", "22"]) == False assert is_valid_year (["12", "31", "-21"]) == False == Hints • Use the type () function from Section 2.1 and review the note in Section 4.3 to see the syntax for checking the type of a variable. • Refer to LAB 6.19 to review how to use the .isdigit() string function, which returns True if all characters in are the numbers 0-9.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

please Use PYTHON

 

```plaintext
Instructions

Write a function is_valid_month(date_list) that takes as a parameter a list of strings in the [MM, DD, YYYY] format and returns True if the provided month number is a possible month in the U.S. (i.e., an integer between 1 and 12 inclusive).

Write a function is_valid_day(date_list) that takes as a parameter a list of strings in the [MM, DD, YYYY] format and returns True if the provided day is a possible day for the given month. You can use the provided dictionary. Note that you should call is_valid_month() within this function to help you validate the month.

Write a function is_valid_year(date_list) that takes as a parameter a list of strings in the [MM, DD, YYYY] format and returns True if the provided year is a possible year: a positive integer. For the purposes of this lab, ensure that the year is also greater than 1000.

Test Your Code

# test incorrect types
assert is_valid_month([12, 31, 2021]) == False
assert is_valid_day([12, 31, 2021]) == False
assert is_valid_year([12, 31, 2021]) == False

Make sure that the input is of the correct type

assert is_valid_month(["01", "01", "1970"]) == True
assert is_valid_month(["12", "31", "2021"]) == True
assert is_valid_day(["02", "30", "2000"]) == False
assert is_valid_day(["12", "31", "2021"]) == True
assert is_valid_year(["10", "15", "2022"]) == True
assert is_valid_year(["12", "31", "2021"]) == True

Now, test the edge cases of the values:

assert is_valid_month(["21", "01", "1970"]) == False
assert is_valid_month(["-2", "31", "2021"]) == False
assert is_valid_month(["March", "31", "2021"]) == False
assert is_valid_day(["02", "33", "2000"]) == False
assert is_valid_day(["02", "12", "31"]) == False
assert is_valid_day(["02", "1st", "2021"]) == False
assert is_valid_day(["14", "31", "2021"]) == False
Transcribed Image Text:```plaintext Instructions Write a function is_valid_month(date_list) that takes as a parameter a list of strings in the [MM, DD, YYYY] format and returns True if the provided month number is a possible month in the U.S. (i.e., an integer between 1 and 12 inclusive). Write a function is_valid_day(date_list) that takes as a parameter a list of strings in the [MM, DD, YYYY] format and returns True if the provided day is a possible day for the given month. You can use the provided dictionary. Note that you should call is_valid_month() within this function to help you validate the month. Write a function is_valid_year(date_list) that takes as a parameter a list of strings in the [MM, DD, YYYY] format and returns True if the provided year is a possible year: a positive integer. For the purposes of this lab, ensure that the year is also greater than 1000. Test Your Code # test incorrect types assert is_valid_month([12, 31, 2021]) == False assert is_valid_day([12, 31, 2021]) == False assert is_valid_year([12, 31, 2021]) == False Make sure that the input is of the correct type assert is_valid_month(["01", "01", "1970"]) == True assert is_valid_month(["12", "31", "2021"]) == True assert is_valid_day(["02", "30", "2000"]) == False assert is_valid_day(["12", "31", "2021"]) == True assert is_valid_year(["10", "15", "2022"]) == True assert is_valid_year(["12", "31", "2021"]) == True Now, test the edge cases of the values: assert is_valid_month(["21", "01", "1970"]) == False assert is_valid_month(["-2", "31", "2021"]) == False assert is_valid_month(["March", "31", "2021"]) == False assert is_valid_day(["02", "33", "2000"]) == False assert is_valid_day(["02", "12", "31"]) == False assert is_valid_day(["02", "1st", "2021"]) == False assert is_valid_day(["14", "31", "2021"]) == False
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Types of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education