和c c++不一樣過程如下: 1 #-*- coding:utf-8 -*- 2 3 t = [[ 0 for i in range(5)]for j in range(5)] 4 5 for i in range(5): 6 for j in range(5): 7 t...
和c c++不一樣
過程如下:
1 #-*- coding:utf-8 -*- 2 3 t = [[ 0 for i in range(5)]for j in range(5)] 4 5 for i in range(5): 6 for j in range(5): 7 t[i][j] = i 8 9 10 for raw in t: 11 print raw
註意第三行,如果沒有那個0是會提示錯誤的SyntaxError: invalid syntax