看板 [ Python ]
討論串[問題] 排列組合問題或邏輯
共 3 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 4→)留言4則,0人參與, 8年前最新作者rexyeah (ccccccc)時間8年前 (2017/10/18 11:11), 8年前編輯資訊
0
0
0
內容預覽:
import itertools. # repeat means how many elements you want in this combination.. for args in itertools.product(range(10), repeat=3):. print list(args
(還有107個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者kilva (嗡嗡)時間8年前 (2017/10/17 19:55), 8年前編輯資訊
0
0
0
內容預覽:
X = [10, 10, 10, 10] # X = [3,8,2,3,4,9,10,3] 也可以執行. a = []. for x in X:. a.append(0). while a[0] < X[0]:. print(a). a[-1] = a[-1] + 1. for n in range
(還有96個字)

推噓6(6推 0噓 3→)留言9則,0人參與, 8年前最新作者aegisqoo (flymetomoon)時間8年前 (2017/10/15 00:23), 編輯資訊
0
0
0
內容預覽:
大家好,我新手也有爬文,有個問題. 假設 a=[x,y,z] 且 0 <= x,y,z <= 9 的 x.y.z組合. 如下:. for x in range(10):. for y in range(10):. for z in range(10):. a=[x,y,z]. print(a). 那
(還有127個字)
首頁
上一頁
1
下一頁
尾頁