- 博客(4)
- 收藏
- 关注
原创 python while实现多行输入
①使用 := 海象运算符 while n := input(): print(n) 可在表达式内部为变量赋值。Python3.8 版本新增运算符。 ② 使用try catch 捕获一个输入否则break
2022-04-25 16:10:45
1308
原创 python 阶乘函数
import math a = math.factorial(n) 应用: 快速求组合数 C(a, b) import math n, m = map(int,input().split()) a = math.factorial(n) b = math.factorial(n) print(a// b // b)
2022-03-30 19:43:20
563
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人