Firstly, these functions perform two different tasks:
' foo bar '.split() is ['foo','bar']
' foo bar '.strip() is 'foo bar'
.
When used strip(' '), only spaces at the beginning and end are removed , although it is very similar to strip(), it is not quite the same, for example, with a tab \tthat is a space, but isn 'a space:
' \t foo bar '. strip() is 'foo bar'
' \t foo bar '. strip(' ') is '\t foo bar'
split(' ') "" , split(), ) ". 'foo bar' ( foo bar).
'foo bar'.split() is ['foo', 'bar']
'foo bar'.split(' ') is ['foo', '', 'bar']
, " ".