Open QiYongchuan opened 7 months ago
Data stractures
# define a list of names names = ["harry","Ron","heri","Ginny"]
# define a dic houses = {"harry":"Gry","Draco":"Sly"} houses['Herminoe'] = "Gry"
coordinateX = 10.0 coordinateY = 20.0 coordinate = (10.0,20,0) #即相当于直接可以用一个变量来代表两个变量
#create an empty set s = set() # add elements s.add(1) s.add(2) s.add(3) s.add(4) s.add(4) s.remove(1) print(s) // 234
python中的数据结构:
Data stractures
list 列表
dic 字典
tuble 元组
set