Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#1. 有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?
count = 0
for i in range(1,5):
for j in range(1,5):
for k in range(1,5):
if (i != j) and (j != k) and (i != k):
count += 1
print i,j,k
print ("There are " + str(count) + " different combinations")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.