Question: PYTHON QUESTION Write a function called parse_line that takes as input a line of text such as Here is some random text, like 5/4-3./12/3/4 and

PYTHON QUESTION

 PYTHON QUESTION Write a function called parse_line that takes as input

a line of text such as Here is some random text, like

Write a function called parse_line that takes as input a line of text such as Here is some random text, like 5/4-3./12/3/4 and converts this into a four tuple of the form: (12, 3, 4, "Here is some random text, like 5/4-3.") where the last three values are converted to integers, and the remainder of the text is a string. The last values are always assumed to be separated by a slash You must however do some error checking. If you do not have a line that has at least three ' in this given format or if the values contained in the last three slots are not integers, then your function should return None. Here are some example runs of this function

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!