美文网首页
2018-11-12

2018-11-12

作者: 记号晴系 | 来源:发表于2018-11-12 16:17 被阅读0次
a = 0#d =[]
for i in range(1,5):
    for j in range(1,5):
        for k in range(1,5):
            if (i != j) and (j != k) and (i != k):
                a+=1#   d.append([i,j,k])
                print (i,j,k)
print("zhongshushi:",a)
#or 另一个例子
from itertools import permutations#itertoos 内置的迭代器

for i in permutations([1, 2, 3, 4], 3):
    print(i)

相关文章

网友评论

      本文标题:2018-11-12

      本文链接:https://www.haomeiwen.com/subject/fpecfqtx.html