BrightXiong 发表于 2023-3-1 21:16:38

列表-Ⅲ

>>> heros = ["蜘蛛侠", "绿巨人", "黑寡妇", "鹰眼", "灭霸", "雷神"]
>>> heros
'灭霸'
>>> heros = ["武松", "林冲", "李逵"]
>>> heros
['蜘蛛侠', '绿巨人', '黑寡妇', '武松', '林冲', '李逵']
>>> nums =
>>> nums.sort()
>>> nums

>>> nums.reverse()
>>> nums

>>> nums =
>>> nums.sort(reverse=True)
>>> nums

>>> nums.count(3)
3
>>> heros.index("绿巨人")
1
>>> nums.index(3, 1, 7)
4
>>> nums_copy1 = nums.copy()
>>> nums_copy1

>>> nums_copy2 = nums[:]
>>> nums_copy2
页: [1]
查看完整版本: 列表-Ⅲ