#範例4-1:四種容器 #(1).串列(list):list串列,就類似Array陣列,a=[1,2,3] a = [1,2,3] print('list=',a) print('list[0]=',a[0]) #(2).集合(set):可以用來做數學的『交集,聯集』計算,a={1,2,3,4} b = {1,2,3,4} c = {3,4,5} print('b & c=',b & c) print('b or c=', b | c) #(3).字典(dict):可以透過『文字』來存取資料(不需要用編號),a={'b1':'john','b2':'tom','b3':'jane'} a={'b1':'john','b2':'tom','b3':'jane'} print(a['b1']) #(4).tuple類似list串列,a = ('tom','mike','peter') a = (1,2,3) print('a[0]=', a[0])