将1234数字,组成不重复的3数字组合,并统计组合个数

total=0
for a in range(1,5):
for b in range(1,5):
for c in range(1,5):
if a!=b and a!=c and b!=c:
total = total + 1
print(a, b, c)
print(total)

 

posted @ 2023-11-29 16:43  琳达的博客  阅读(62)  评论(0编辑  收藏  举报