I'm teaching myself programming using Python and want to build a list
inside a function (rather like using a static variable in a Fortran
subroutime - the list must not disappear as soon as the subroutine is
exited). What's the simplest way to do this?
I'd like to write something of the form
def myroutine(x)
mylist = mylist.append(x )
print mylist
inside a function (rather like using a static variable in a Fortran
subroutime - the list must not disappear as soon as the subroutine is
exited). What's the simplest way to do this?
I'd like to write something of the form
def myroutine(x)
mylist = mylist.append(x )
print mylist
Comment