以下内容转自 数析学院,只节选了部分,有需要的同学可以直接查看原文
导入 Packages
一、列表
1、生成列表
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
2、列表切片
first item 0last item 9first three items [0, 1, 2]last three items [7, 8, 9]start at the 4th item [3, 4, 5, 6, 7, 8, 9]the odd items [0, 2, 4, 6, 8]
length of list 10largets number in list 9smallest number 0average 4.5the largest number in the list is 9 and is found at index: 9
3、添加元素
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 3, 4]
sorted list [0 1 2 3 3 4 4 5 6 7 8 9]select distinct values [0 1 2 3 4 5 6 7 8 9]
以上内容转自 数析学院,其他一些基础内容有时间再补齐,有需要的同学可以直接查看原文