1. Using the list method to convert a string to a character list, the list function converts the string to a separate letter
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M00/8F/62/wKiom1jcnIuAS2YyAAAIKyYOUwI949.png "title=" List-str. PNG "alt=" Wkiom1jcniuas2yyaaaikyyouwi949.png "/>
2. Use Split () to convert a string into a sequence of words
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M01/8F/62/wKiom1jcna7B4rbEAAAI8GZVcI4312.png "title=" List-split. PNG "alt=" Wkiom1jcna7b4rbeaaai8gzvci4312.png "/>
Split () method syntax:
Str.split (str= "", Num=string.count (str)).
Parameters
STR--the delimiter, which defaults to all null characters, including spaces, line breaks (\ n), tabs (\ t), and so on.
Num--the number of splits.
Example
The following example shows how the split () function is used:
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/8F/60/wKioL1jcoQuxdXR7AAAKS4aH-H4553.png "title=" Split2. PNG "alt=" Wkiol1jcoquxdxr7aaaks4ah-h4553.png "/>
The 3.join function, in contrast to the split function, is a string method, so you must specify a delimiter and use the list as a parameter
Example
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/8F/62/wKiom1jcot7y_iTBAAALGAg1fqU312.png "title=" join. PNG "alt=" Wkiom1jcot7y_itbaaalgag1fqu312.png "/>
This article is from the "Quiet Program Daughter" blog, please be sure to keep this source http://emily18.blog.51cto.com/7121141/1911737
Python---list lists with string list (), Split (), join ()