1、指定列表中的数据进行修改  即列表名[i]=新的元素

python之列表数据进行修改

 

 2、让列表中的元素进行逆置

python之列表数据进行修改

 

 3、对列表中的元素进行排序sort(reverse=false or true)  reverse是默认升序的 如果说是降序需要将reverse=true  ;升序则是reverse=false

python之列表数据进行修改

 

4、复制数据 即把num的数据复制给num1   调用方法  num.copy()

python之列表数据进行修改

 

 5、综上指定数据进行修改、对列表中的元素进行逆置、对列表中的元素进行排序、复制数据

    (1)指定下标进行修改,即列表名[i]=新元素

    (2)列表中的元素进行逆置 即 列表名.reverse()

      (3) 对元素进行排序,降序则是 reverse=true  升序则是 reverse=false

      (4)复制列表  即num1=num.copy()

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2022-01-07
  • 2021-11-28
  • 2021-11-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2023-02-20
  • 2021-07-22
  • 2022-12-23
  • 2022-01-02
  • 2021-12-29
相关资源
相似解决方案