1 s1 = "we are family"#中间一个空格 2 s2 = "we are family"#中间两个空格 3 s3 = "we are family"#中间三个空格 4 s4 = "we are family"#中间四个空格 5 6 s1 = s1.split(" ") 7 s2 = s2.split(" ") 8 s3 = s3.split(" ") 9 s4 = s4.split(" ") 10 11 print(s1)#['we', 'are', 'family'] 12 print(s2)#['we', '', 'are', '', 'family'] 13 print(s3)#['we', '', '', 'are', '', '', 'family'] 14 print(s4)#['we', '', '', '', 'are', '', '', '', 'family']
1 s1 = "we are family"#中间一个空格 2 s2 = "we are family"#中间两个空格 3 s3 = "we are family"#中间三个空格 4 s4 = "we are family"#中间四个空格 5 6 s1 = s1.split() 7 s2 = s2.split() 8 s3 = s3.split() 9 s4 = s4.split() 10 11 print(s1)#['we', 'are', 'family'] 12 print(s2)#['we', 'are', 'family'] 13 print(s3)#['we', 'are', 'family'] 14 print(s4)#['we', 'are', 'family']