Python:列表,元组,字典,集合知识整理

初学Python很容易混淆列表,元组,字典和集合,下面是整理的具体使用区别:

举例如下:
test_list = [4,2,3,1,4] 列表
test_tuple = (5,2,1,3,4) 元组
test_set = {12,4,6,5} 集合
test_dict = {"a":1, "b":2} 字典

posted @ 2024-12-18 17:30  私人收藏夹  阅读(29)  评论(0)    收藏  举报