from math import factorial
import math
def get_bernoulli(n):
b = 0
sum = 0
for k in range (0, n-1):
part = (factorial(n)) / factorial(k) * factorial(n+1 - k)))*b
sum += part
b = -(1/n+1)*sum
pycharm抱怨n k和b。它显示未解决的参考。这意味着什么?
答案 0 :(得分:0)
让我们来计算这一行中的括号:
part = (factorial(n)) / factorial(k) * factorial(n+1 - k)))*b