Question: Question 2 . 2 . Next, define a function called extract _ year _ as _ int , which takes as input a string formatted

Question 2.2. Next, define a function called extract_year_as_int , which takes as input a string formatted like 'Dec 10,2019', and outputs the year as an int . For example, the function evaluated on the string 'Dec 10,2019' should return the int 2019.
Hint: The string method .split() will be helpful here.
In []: # Define your function here.
cdots
# Test case for your reference. Feel free to test out more!
example = extract_year_as_int ( 'Feb 01,2024')
example
In []: grader.check("q2_2")
 Question 2.2. Next, define a function called extract_year_as_int , which takes

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!