Python基礎入門之條件判斷和循環二

3.4、Python之for循環數組 list或tuple能夠表示一個有序集合。若是咱們想依次訪問一個list中的每個元素呢?好比 list:spa L = ['Adam', 'Lisa', 'Bart']orm print L[0]it print L[1]for循環 print L[2]變量 若是list只包含幾個元素,這樣寫還行,若是list包含1萬個元素,咱們就不可能寫1萬行print。循
相關文章
相關標籤/搜索