- #!/usr/bin/python
- print "++++++++++list to tuple+++++++++++++++++++++"
- list1=['computer','apple','orange','shopping']
- print type(list1)
- print list1
- T1=tuple(list1)
- print type(T1)
- print T1
- print "++++++++++tuple to list++++++++++++++++++++++"
- L1=list(T1)
- print type(L1)
- print L1
- print "++++++++++string to list ++++++++++++++++++++"
- S1="my english teacher is kevin"
- LL1=list(S1)
- print LL1
- LL2=S1.split()
- print LL2
- print "++++++++++list to string ++++++++++++++++++++"
- L2=['uliweb','ulipad','plugs','uliwebzone']
- L3=['a,b,c\n','d,e,f\n']
- for S2 in L2[:]:
- print type(S2),S2
- S2=str(L2)
- print type(S2),S2.strip('[|]')
- print L3[0].strip()
- print L3[1].strip()
转载于:https://blog.51cto.com/5iqiong/1167124