1、元祖打印
Tu = (1,2,3,'Alex',[2,3,4,'taibai'],'egon') print(Tu[3])
2、元祖字符转大写
Tu = (1,2,3,'Alex',[2,3,4,'taibai'],'egon') Tu[4][3] = Tu[4][3].upper() print(Tu)
3、元祖中的子元素添加信息
Tu = (1,2,3,'Alex',[2,3,4,'taibai'],'egon') Tu[4].append('SB') print(Tu)
4、元祖中的Join方法
S = 'SHULEI' S1 = '++'.join(S) print(S1)
5、列表与字符串自己的转换
1、字符串转列表 .split() 2、列表转字符串.jion
6、Range的使用
for i in range(0,10): print(i) for i in range(0,10,3): print(i)
for i in range(10,0,-3):
print(i)
标签:10,Alex,Python,Day4,Tu,egon,print,元祖 From: https://www.cnblogs.com/leishu/p/16826330.html