标签:指定元素 nbsp 指定 dex index 增删改 csharp bsp 计算
列表是可以修改的
元祖是不可以修改的
元祖不能进行增删改操作
tu = ("a","b","c","d") print(tu[0]) print(tu[0:2]) print(len(tu)) for i in tu: print(i) a (‘a‘, ‘b‘) 4 a b c d
其他方法
tu = ("a","b","c","d") print(tu.count(‘d‘)) 1
tu = ("a","a","b","c","d","b","b") print(tu.index(‘b‘)) 2
标签:指定元素 nbsp 指定 dex index 增删改 csharp bsp 计算
原文地址:https://www.cnblogs.com/yyxx8888/p/12637101.html