What is the output?
print(len('a b'.split()), len('a b'.split(' ')))
- 2 2
- 3 3
- 3 2
- 2 3
split() with no argument splits on runs of whitespace; split(' ') splits on every single space, leaving an empty string between the two spaces: ['a', '', 'b'].
Play Problem Solving ▸