<>1. list list--------> character string str

First case , If list [ ] The elements contained in are str " " type .
Use the following method , give an example .
nums=['ww','22','2s'] print("".join(nums))
Operation results :

ww222s

The second situation , If the list [ ] The elements in it are shaping int , It needs to be reshaped int convert to str type .
nums=[1,2,3,4,5] strNums=[str(x) for x in nums] print("".join(strNums))
Input results :

12345

<>2. character string str----------> list list
strnums1='12123112' strnums2='sdfsdsdf' listnums1=list(strnums1) listnums2=list
(strnums2) print(listnums1) print(listnums2)
Output results :

[‘1’, ‘2’, ‘1’, ‘2’, ‘3’, ‘1’, ‘1’, ‘2’]
[‘s’, ‘d’, ‘f’, ‘s’, ‘d’,‘s’, ‘d’, ‘f’]

Technology
©2020 ioDraw All rights reserved
Swing actual combat Understanding closure about vue in el-date-picker type=daterange The problem of date not echoing Ubuntu 18.04 swap Partition expansion Snake code --c Language Edition visual c++6.0 open 【Golang Basic series 10 】Go language On conditional sentences ifString class —— summary ,String The nature of , Memory resolution , Commonly used APIAdobe Illustrator Publish native support Apple Silicon Test version of the software study java My first class antd table sort