Answers for "split() vs split(' ')"

0

split() vs split(' ')

# split() vs split(' ')
sample = "a  b "
sample.split()
>>> ['a', 'b']
sample.split(' ')
>>> ['a', '', 'b', '']
Posted by: Guest on September-30-2021

Python Answers by Framework

Browse Popular Code Answers by Language