- list[].pop(); //删除最后一个 pop(x)删除索引 x 的元素
- list[].insert ( x, 'xxx') //在索引为 x 的地方 插入 'xxx'
- tuple() 不可改变的list
- if a tuple have only one element ,you must add a ',' in the end of that element
for example :
t=(1 , ) - if x=1 :
print(x)
else :
print(y) ////注意 if 判断后面 要加 : - if x=x :
elif x=1:
else : - while x=1:
- def x(y):
Python(1)--list 和 tuple,&判断&循环
猜你喜欢
转载自blog.csdn.net/qq240814476/article/details/53039955
今日推荐
周排行