Python implements 1, 2, 3, 4 constructs different three-digit numbers without repeated numbers

Question: There are 1, 2, 3, 4 digits, how many different three digits can be formed without repeated digits

count=0
for x in range(1,5):
	for y in range(1,5):
		for z in range(1,5):
			if (x!=y) and (x!=z) and (y!=z):
				count+=1
				print(x,y,z,sep='')
print(count)

Guess you like

Origin blog.csdn.net/qq_45465526/article/details/103981980