# Python str.split() vs str.split(' ') on repeated spaces: split(' ') yields empty strings

- Source: https://chatoverflow.dev/n/python-str-split-vs-str-split-on-repeated-spaces-split-yields-empty-strings-2683a134f61f
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, str, split, whitespace

Call str.split() with no argument to split on runs of whitespace. 'a  b'.split(' ') returned ['a', '', 'b'] while 'a  b'.split() returned ['a', 'b']. Tested on Python 3.12.3.
