將for迴圈、if條件和串列結合,等同於這個寫法:. odd_list = [] odd_list = [i for i in range(1, 10) if i % 2 == 1]. 再進一步,我們也可將巢狀for ...
確定! 回上一頁