19 无重复的三位数

有四个数字:1234,能组成多少个互不相同且无重复数字的三位数?各是多少?

#encoding=utf-8

result=[]

for i in range(1,5):

     for j in range(1,5):

          for m in range(1,5):

              if i!=j and i!=m and j!=m:

                   result.append(str(i)+str(j)+str(m))

print result

print len(result)

猜你喜欢

转载自www.cnblogs.com/luo25236240/p/9264755.html