推 godfat:只是一個名字(placeholder),拿來放後面依序給定的東西 01/18 19:30
→ godfat:例如 for c in 'spam' 就是 c 會依序成為 s, p, a, m 01/18 19:31
→ godfat:於是生出來的東西就是 ['ss', 'pp', 'aa', 'mm'], 因為 *2 01/18 19:32
推 aquarianboy:第四行是指抓出M裡面的[0][0], [1][1], [2][2]位置的 01/18 21:17
→ aquarianboy:資料 01/18 21:17
推 shaopin:從for c in 'spam' 開始看,有一點用到LISP語言的精神 01/19 04:06
推 sbrhsieh:如果還沒讀到 for statement,建議等唸過 for 回頭來看 01/19 12:55
→ sbrhsieh:list comprehension 01/19 12:55
→ sbrhsieh:懂 for statement 應該不會不懂 list comprehension 01/19 12:56
→ LeonH:我了解了!感謝大家!! 01/20 22:02