方法一
三个循环
def not_repeat(params):
# 定义一个空列表
mlist = []
count = 0
for i in params:
for j in params:
for m in params:
# 三个数不相等
if i != j and j != m and i != m:
mlist.append(i+j+m) # params 为字符串,字符串拼接
count += 1
print("一共有 {} 种组合,分别是 {}" .format(count, mlist))
not_repeat('1234')
标签:count,repeat,python,mlist,三位数,params,重复
From: https://www.cnblogs.com/wwho/p/16948312.html