Question: Python: for loop function def clean_span_data(raw_spans: str) -> List[float]: Return a list of span lengths from raw_spans, in the same order that they appear in

Python: for loop functionPython: for loop function def clean_span_data(raw_spans: str) -> List[float]: """Return a list

def clean_span_data(raw_spans: str) -> List[float]: """Return a list of span lengths from raw_spans, in the same order that they appear in raw_spans.

Precondition: - raw_spans is in the appropriate format (see handout for details)

>>> clean_span_data('Total=64 (1)=12;(2)=19;(3)=21;(4)=12;') [12.0, 19.0, 21.0, 12.0] """

Total=60.6 (1)=30.3; (2)=30.3; More generally, the format is: Total=[total length of all spans] (1)=[the length of the first span];(2)=[the length of the second span]; and so Some things to notice about this format: o There is no semicolon after the total length o There is a semicolon after every span length o Each span length has a prefix of the form (x)= where x is a number starting from 1 and increasing by 1 for every span

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!