题目一:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?
代码:
nums=0
for a in range(1,5):
for b in range(1,5):
for c in range(1,5):
if a !=b and b != c and a != c:
nums+=1
print "3 num is :",a,b,c
print "总共是%s组" %nums
转载于:https://blog.51cto.com/tianbright/1760039