Basic Ghpython Question (sigma ∑)

Hi.

This is a simple script I wrote to make ∑2^i (from range 0 to x) function, which was expected to be working like :

x=0 ; 2^0 = 1
x=1 ; 1(2^0) + 2^1 = 3
x=2 ; 3(2^0 + 2^1) + 2^2 = 7
x=3 ; 7(2^0 + 2^1 + 2^2) + 2^3 = 15
.
.
so on.

When typing the number directly into the script, it seems to be working right.

20221016_170000

However with input data it doesn’t work correctly.

20221016_170203

Do you know the way to fix this…

ghpython_sigma.gh (5.4 KB)

right click on Python’s input “x” and chose List access :+1:

1 Like