as the title says I have the problem that I can't do a function, where the list is expanding continuously to some value. I need this for a bigger program I'm writing.
Here are two examples that don't work. first one:
from random import *
import time
A = []
def list_expander(A):
A = A + [randint(-5,5)]
print (A)
while True:
list_expander(A)
time.sleep(2)
and second one:
from random import *
import time
def list_expander():
A = []
A = A + [randint(-5,5)]
print (A)
while True:
list_expander()
time.sleep(2)
thank you for your help!