How to do a Sigma in python 3 - Stack Overflow

PHOTO EMBED

Fri Oct 21 2022 09:00:07 GMT+0000 (Coordinated Universal Time)

Saved by @ebeanes28 #python

def sigma(first, last, const):
    sum = 0
    for i in range(first, last + 1):
        sum += const * i
    return sum

# first : is the first value of (n) (the index of summation)
# last : is the last value of (n)
# const : is the number that you want to sum its multiplication each (n) times with (n)
content_copyCOPY

https://stackoverflow.com/questions/33422534/how-to-do-a-sigma-in-python-3