0

How do I loop adding a number to an variable

So let's see.... My variable name is x and I want to loop adding a number to x. How?

25th Dec 2020, 2:36 AM
DRA701
DRA701 - avatar
4 Respuestas
+ 2
DRA701 Yes you can use but don't forget to write break otherwise loop will run forever.
25th Dec 2020, 3:24 AM
A͢J
A͢J - avatar
0
Well, there are many solutions for that. You could use a for loop, a good old fashioned while loop, or even use reduce, for loops or for each if the values you want to add are part of an array.
25th Dec 2020, 2:54 AM
Bryan Moreno
Bryan Moreno - avatar
0
Bryan Moreno can I use python's while True loop?
25th Dec 2020, 3:03 AM
DRA701
DRA701 - avatar
0
25th Dec 2020, 3:26 AM
DRA701
DRA701 - avatar