【笔记3-31】Python语言基础-列表list

列表list

my_list = [1, 2, 3, 4, 5]

  索引index

my_list[0]

  获取列表长度

len(my_list)

  切片 [起始:结束:步长]

my_list[1:3:2]

  + 拼接列表

  * 重复次数

  in 检测是否在

  not in 

  max()

  min()

  .index() 第一次出现的索引

  .count() 出现次数

    

猜你喜欢

转载自www.cnblogs.com/ZZBD/p/12605122.html