标签:print 元素 split col color nbsp div span lis
lis = [[‘k‘,[‘qwe‘,20,{‘k1‘:[‘tt‘,3,‘1‘]},89],‘ab‘]] lis[0][1][2][‘k1‘][0] = ‘TT‘ print(lis) lis[0][1][2][‘k1‘][0]=lis[0][1][2][‘k1‘][0].upper() print(lis) lis[0][1][2][‘k1‘][1]= ‘100‘ print(lis) lis[0][1][2][‘k1‘][1:2]= [‘100‘] print(lis) lis[0][1][2][‘k1‘][2]= 101 print(lis) lis[0][1][2][‘k1‘][2:3]= [101]#给切片赋值 要将元素打散 print(lis)
s = ‘alexwusirlex‘ li = s.split(‘l‘,1) print(li) s = ‘alex‘ li[:] = s s = ‘_‘.join(li) print(s) #a_l_e_x
标签:print 元素 split col color nbsp div span lis
原文地址:https://www.cnblogs.com/limw/p/9689490.html