Total Complexity | 5 |
Total Lines | 13 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | def cleaner(source: str): |
||
2 | lines = source.split('\n') |
||
3 | for i in range(len(lines)): |
||
4 | strings = lines[i].split() |
||
5 | for string in strings: |
||
6 | if string[0] == ';': |
||
7 | index = strings.index(string) |
||
8 | delete = strings[index:] |
||
9 | for item in delete: |
||
10 | strings.remove(item) |
||
11 | lines[i] = ' '.join(strings) |
||
12 | return '\n'.join(lines) |
||
13 |