Adding up list items

Hi guys, I’ve trying to store scores of different levels in a list and add up the scores of each level to get the overall score. I’ve used the following code to achieve the objective -

At first, the score_list is getting uploaded to TinyDB, from where I’m fetching scores of individual levels to show on the screen. But the speadsheet doesn’t reflect the sum of the list items, only stores the score of the first level.

Can anybody point out what’s wrong with the logic…?

Use a for each item in list loop:
Set global final_score = global final_score + item

Taifun

1 Like

Tried, but unfortunately, the app it is causing the app to crash…

upon its removal, the app works fine…

remove the set cell , and instead of that use any one label and try to print the outcome of global final_score…

If you are able to see the result in label, then use one clock component to trigger here, and move the set cell block when the clock timers , just try , i am not sure

Nevermind, I’ve sent the score as a startvalue to another screen and then added up all the list items.

Thank you both @Still-learning & @Taifun for helping

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.