easy +8 pts

Extract Quoted Strings

Parse a line of text and return the contents of all quoted substrings.

Write a function `extract_quoted(text: str) -> list` that scans the input string and returns a list of the contents of every substring enclosed in double quotes (`"`). The quotes themselves are not included in the output. The function must handle multiple quoted segments, including adjacent quoted segments like `"a""b"`. If there are no quoted segments, return an empty list. The input will always be a string.

Constraints

0 <= len(text) <= 1000. The input may contain quotes that are not closed; in that case, ignore the unclosed segment. Quoted strings cannot contain escape characters or nested quotes. The output list should preserve the order of appearance in the original string.

Example

```python
>>> extract_quoted('He said "hello" and "goodbye"')
['hello', 'goodbye']
>>> extract_quoted('No quotes here')
[]
>>> extract_quoted('"one" "two" "three"')
['one', 'two', 'three']
```
8 points ~12 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Loop through the string character by character and track when you are inside a quote.
When you encounter a closing quote, append the collected characters to the result.
If you run out of characters while inside a quote, simply discard the collected content.
Adjacent quotes like '"a""b"' should produce ['a', 'b'].
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.