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 function![Python: for loop function def clean_span_data(raw_spans: str) -> List[float]: """Return a list](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3baa7db400_06366f3baa7588d0.jpg)
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
Get step-by-step solutions from verified subject matter experts
