split的差异
字符串变形
https://www.nowcoder.com/practice/c3120c1c1bc44ad986259c0cf0f0b80e
list1 = "dsd ssdsd dss ref " list2 = list1.split() print(list2) list4 = list1.split(' ') print(list4) ##output: ['dsd', 'ssdsd', 'dss', 'ref'] ['dsd', 'ssdsd', 'dss', 'ref', '']
list1 = "dsd ssdsd dss ref" list2 = list1.split() print(list2) list4 = list1.split(' ') print(list4) output: ['dsd', 'ssdsd', 'dss', 'ref'] ['dsd', 'ssdsd', 'dss', 'ref']