I would like to add values within a list

Hello, I have a doubt.
I would like to add values within a list
Example: (10, 15, 20) Result:
(10 + 15 + 20) = 45
Maybe I may not have expressed myself well, my English is not so good.

Use select list item with index block for each item in list and add them with addition block from maths.

2 Likes

You can also try this using a for each item in list block whereas your items are the variables you have as a list.Also you will need to have a variable (local/global) which will be the result variable.The final number will be in.Then you will add inside your for loop, the set variable block,to set the result variable to : the result + the item.
And the result variable will contain the total

4 Likes

@Mohamed_Tamer Your contribution to the community is great but you need be patient while providing ready blocks.

First, let the users try something on their own, if they face problems then we are here to help them to resolve their issues.

This is the way to learn Koding without Coding.

We are here to teach how to fish not to give ready fish! :joy:

Don’t misunderstand me…:grinning:

4 Likes

#off-topic
Well, you right @The_K_Studio .I really shouldn’t provide blocks when it’s not necessary.I will delete the blocks from my post as well.I really provide them because i felt my description wasn’t good.But still this isn’t right.Any way thanks for reminding me with this:wink:

2 Likes

@The_K_Studio
#off-topic
Hey ! You liked that phrase, right? :grinning: :+1:t2:
I always say that … :+1:t2:

2 Likes

By using simple logic with Taifun Math extension you can do it. before result, call replace block + (plus) instead of ,(comma)
Taifun Math Extension