Question: Checkpoint 1: More Text Processing Practice Write a function called parse line that takes as input a line of text such as Here is some

 Checkpoint 1: More Text Processing Practice Write a function called parse
line that takes as input a line of text such as Here

Checkpoint 1: More Text Processing Practice 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: >>print (parse.line("Here is some random text, like 5/4-3./12/3/4")) (12, 3, 4, 'Here is some random text, like 5/4-3.') print (parse.line("Here is some random text, like 5/4-3./12/3/4as*)) lke 5/4-3./12/412/a/3/4")) >>>print (parse-line ("Here None is some random text, >print (parse line" Here is some spaces 12/32/4))

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!