求编程高手python
1个回答
展开全部
def Factorial(n):
if n<0:
print "者烂参数必须为非逗含负整首指漏数"
elif n==0:
return 1
else:
return n*Factorial(n-1)
people=10
jia=2
yi=1
bing=1
result=Factorial(people)/(Factorial(people-jia)*Factorial(jia))
people-=jia
result*=Factorial(people)/(Factorial(people-yi)*Factorial(yi))
people-=yi
result*=Factorial(people)/(Factorial(people-bing)*Factorial(bing))
print "共有选法:%d种"%result
共有(10!/[(10-2)!*!2!])*(8!/(8-1)!*1!)*(7!/[(7-1)!*1!)种选法
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询