赞
踩
- def pythonit():
- a = 1
- for i in range(1,10):
- a = a*i
- print(a)
- pythonit()
进阶写法:
- def python(n):
- a = 1
- for i in range(1,n=1):
- a = a*i
- return a
- def pythonit():
- n = int(input("请输入一个数计算其阶乘:")
- result = python(n)
- print(f"{n}的阶乘为:{result}")
- pythonit()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。