题目:有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?
解答:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
num=[1,2,3,4]
i=0
for a in num:
for b in num:
for c in num:
if(a!=b) and (b!=c) and (c!=a)
i=i+1
print(a,b,c)
print("总数是:",i)
标签:comment for log pytho png 技术分享 总数 div 分享
题目:有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少?
解答:
#!/usr/bin/python
# -*- coding: UTF-8 -*-
num=[1,2,3,4]
i=0
for a in num:
for b in num:
for c in num:
if(a!=b) and (b!=c) and (c!=a)
i=i+1
print(a,b,c)
print("总数是:",i)
标签:comment for log pytho png 技术分享 总数 div 分享
原文地址:https://www.cnblogs.com/mxt78/p/8444469.html