Question: I'm trying to make a calculator for something, but the formulas use a sigma, I have no idea how to do a sigma in python, is there an operator for it?
Ill put a link here with a page that has the formulas on it for illustration:<http://fromthedepths.gamepedia.com/User:Evil4Zerggin/Advanced_cannon>

Answer: 
Captial sigma (Σ) applies the expression after it to all members of a range and then sums the results.

In Python, `sum` will take the sum of a range, and you can write the expression as a comprehension:

For example
[Speed Coefficient](https://fromthedepths.fandom.com/wiki/Advanced_Cannon#Speed_Coefficient)

> 
> A factor in muzzle velocity is the speed coefficient, which is a
> weighted average of the speed modifiers si of the (non-
> casing) parts, where each component i starting at the head has half the
> weight of the previous:
> 
> 
> [![s={\frac {\sum 0.75^{i}s_{i}}{\sum 0.75^{i}}}}](https://i.stack.imgur.com/Pklv3.png)](https://i.stack.imgur.com/Pklv3.png)
> 
> 
> The head will thus always determine at least 25% of the speed
> coefficient.
> 
> 
> For example, suppose the shell has a Composite Head (speed modifier
> 1.6), a Solid Warhead Body (speed modifier 1.3), and a Supercavitation
> Base (speed modifier 0.9). Then we have
> 
> 
> s0=1.6
> 
> 
> s1=1.3
> 
> 
> s2=0.9
> [![s={\frac {0.75^{0}\cdot 1.6+0.75^{1}\cdot 1.3+0.75^{2}\cdot 0.9}{0.75^{0}+0.75^{1}+0.75^{2}}}\approx 1.33}](https://i.stack.imgur.com/YMNAE.png)](https://i.stack.imgur.com/YMNAE.png)
> 
> 
> 

From the example we can see that *i* starts from 0 not the usual 1 and so we can do

```py
def speed_coefficient(parts):
    return (
        sum(0.75 ** i * si for i, si in enumerate(parts))
        /
        sum(0.75 ** i for i, si in enumerate(parts))
    )

```

```
>>> speed_coefficient([1.6, 1.3, 0.9])
1.3324324324324326

```
```
import numpy as np

def sigma(s,e):
  x = np.arange(s,e)
  return np.sum([x+1])

```