Sigma, pi exercise

Write programs (for and while) that calculate the sum (product) (using inconditional statement, omit elements that generate the error)

The print statement in each loop should beoutput a string containing the value of the loop counter, the value of the element (in the case of error generating elements, the string ——) and the current one value of the sum (product) with a precision of 5 digits after the decimal point.

Well any advices, i just dont know how to implement that if there are negative numbers, also when cosinus showed up.

I want to implement it in PYTHON.
My code so far:

s = -4
    for i in range(-4, n+1):
        total *= s + 5 / s + 1
        s = s + 1
     print ("[n==%d] Suma = %s" %(n, total))


Welcome, korneliuszburian.

Specifically, what are you struggling with? Do you understand the symbols and equation?

Are you aware there is a standard library math with a cos function? It is used like:

import math

x = math.cos(3.14159/2) # there is also math.pi

Hope this helps