Python如何计算连乘?

1 个回答

Coco老师 - 科普专家
擅长:编程教育
sum = 1;
n = int(input("Please input number n:"))
for i in range(1,n+1):
sum = sum*i;
if i<n:
print(i,end='')
print("*",end = '')
print(i,"=",sum)