python循环结构程序设计第4章上机作业怎样解答? 5
1个回答
展开全部
def getShang(j):
curmul = 1
for j in range(1,j):
curmul *= j
return curmul
res=1.0
for i in range(2,50):
res += 1.0/getShang(i)
print('%f' % res)
--------------------------------------------
I use python 2.7 version, hope can help you
curmul = 1
for j in range(1,j):
curmul *= j
return curmul
res=1.0
for i in range(2,50):
res += 1.0/getShang(i)
print('%f' % res)
--------------------------------------------
I use python 2.7 version, hope can help you
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询