The Spaces Between
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant feedback.
- Domain
- Python
- Difficulty
- easy
- Seniority
- L3
Problem
Access-log lines arrive with ragged whitespace: fields run together under uneven spacing and stray leading or trailing gaps. Break each `line` into its whitespace-separated fields, keeping only the real tokens, and hand back an empty list when a line holds nothing but whitespace.
Summary
Raw lines arrive padded and uneven. Recover the fields that matter.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and checks it automatically.