Python(1)--list 和 tuple,&判断&循环

  1. list[].pop(); //删除最后一个  pop(x)删除索引 x 的元素
  2. list[].insert ( x, 'xxx')      //在索引为  x 的地方  插入   'xxx'
  3. tuple() 不可改变的list
  4. if a tuple have only one element ,you must add a ',' in the end of that element
    for example :
           t=(1 , )





  5. if x=1 :
        print(x)
    else :
        print(y)        ////注意  if 判断后面   要加  :
  6. if   x=x :
    elif x=1:
    else  :
  7. while x=1:


  8. def x(y):
         

猜你喜欢

转载自blog.csdn.net/qq240814476/article/details/53039955
今日推荐