from sympy import Sum, var, oo -sharp
i = var('i')
formula = Sum(1/i**4, (i, 1, oo))
res = formula.doit()
result:
pi**4/90
from sympy import Sum, oo, var
k = var('k')
print(Sum(1/k**4, (k, 1, oo)).doit())
output
pi**4/90
add a little bit to the upstairs. If oo reports an error, add oo
after import above.import math
math.pi ** 4 / 90
as for the previous infinite sum, it can't be done (although, there is np.Infinity in numpy for )
sum(map(lambda i: 1 / i**4, range(1, inf)))