Return a copy of array with comments removed. Lines starting with '--' (but not with '---') are removed.
(a: list[str])
| 199 | |
| 200 | |
| 201 | def remove_comment_lines(a: list[str]) -> list[str]: |
| 202 | """Return a copy of array with comments removed. |
| 203 | |
| 204 | Lines starting with '--' (but not with '---') are removed. |
| 205 | """ |
| 206 | r = [] |
| 207 | for s in a: |
| 208 | if s.strip().startswith("--") and not s.strip().startswith("---"): |
| 209 | pass |
| 210 | else: |
| 211 | r.append(s) |
| 212 | return r |
| 213 | |
| 214 | |
| 215 | def print_with_line_numbers(s: str) -> None: |