Question: need help with this python assigment Part IV: From Human-readable Time Intervals to Date Components (5 points) Write the function readable-interval that takes a string
need help with this python assigment
Part IV: From Human-readable Time Intervals to Date Components (5 points) Write the function readable-interval that takes a string consisting of a human-readable time interval Homework #3 CSE 101 Spring 2017 Page 3 and converts it into a list of six integers, given in this order: of years, of months, of days, of hours, of minutes, t of seconds]. The input values stored within the string can be quite scrambled and consist of multiple, repeated time components (days, months, etc.), as shown in the examples below. If a time component appears more than once, the values are be added. The time units might be given in singular or plural form (e.g., "month" and "months" are both valid) There will always be at least (but not necessarily exactly) one space between the tokens (i.e., components) of the string. Examples: Function Call: readable interval 1 year 2 months 3 seconds' Return Value: 11, 2, 0, 0, 0, 31 Function Call: readable interval 1 second 2 years 3 seconds 7 months 6 days' Return Value: 2 7, 6, 0, 0, 4 Function Call: readable interval 1 days 4 days 3 years 4 hours 17 minutes') Return Value: 3, 0, 5, 4, 17, 01 Function Call: 20 minutes 421 seconds readable interval 6 hour Return Value: [0, 0, 0, 6, 20 421 Function Call: o months 7 months readable. interval 0 days 18 years' Return Value: 18 7, 0, 0, 0, 0Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
