Problem in output value while applying loop with value list and multiplication of list with a number

Hi,
I am facing some problems while applying the loop to get one value at once for two different options using a value list. The problem is, it is showing the same value for both the options. Perhaps I am not applying the loop properly.
(In 1st Python script)

Also, I need some help in multiplying a list of numbers with a number using python. The screenshot and code file is attached here. (In 2nd Python script)

I will be thankful if someone helps me.

Area_Problem.gh (15.9 KB)

You can make it simple

Area_Problem_re.gh (29.5 KB)

2 Likes

Ah! Thanks a lot @seghierkhaled
Now it works perfectly!

Sorry i made mistake you must use power instead of sqrt and you can use another method

import math
if S == “Rectangle”:
a = A x B x float(y)
elif S == “Circle”:
a = math.pi x math.pow(R, 2) x float(y)

Area_Problem_re2.gh (21.5 KB)

1 Like

Oh, I see!
I have counter checked the value, it is right now!

Thank you again for the correction @seghierkhaled :slight_smile:

1 Like