直接將變數指定一個list,x = [1,"hello",333,"day"]
若要使list()函數來指定,x = list([]),參數一定要直接是有[]的list格式,例如 x = list([123,"hello",999,"ok"]),唯二的例外是如果直接在list()中給一個字串,則視為給一個字元的list。例如
x = list("idea"),則 x = ['i','d','e','a'] 。另外是給一個range則視為各數字的list,例如 x = list(range(2,9)),則 x = [2,3,4,5,6,7,8]