'''
由数字1-2-3-4组成一个不含重复数字的3位数,有多少个?
#count用计算不重复数的个数
count =0
#estimate用来匹配这个3位数必须包含数字1-2-3-4这4个数字其中的3个
estimate ='1234'
#生成用来组成这个3位中从最小到最大的序列
for iin range(123,433):
#将生成数字转字符串待处理
str1 =str(i)
#判断这三位数两两不能重复并且三个数字也不重复
if ((str1[0]==str1[1]) == (str1[0]==str1[2]) == (str1[1]==str1[2]))and str1[0]!=str1[1]!=str1[2]:
#判断这个3位数每一个数字必须包含estimate中
if (str1[0]in estimate)==(str1[1]in estimate)==(str1[2]in estimate):
count +=1
#输出正确的3位数
print(str1)
# 输出正确的3位数计数总和
print('count=',count)
'''
输出结果
'''
123
124
132
134
.....
432
count= 24
'''