002. 有1、2、3、4四个数,能组成多少个互不相同且无重复的
2018-07-23 本文已影响0人
邵梦寒
list_num = [1, 2, 3, 4]
all_num = []
for i in list_num:
for j in list_num:
for k in list_num:
if (i!=j) and (i!=k) and (j!=k):
num = i*100 + j*10 + k
all_num.append(num)
print(all_num)
print('A total of %d numbers.' %len(all_num))