Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: local/global variables in functions
Post: RE: local/global variables in functions

it is a nice suggestion but does not solve the problem I was addressing. The list is created while the program is running. Is there away to creat a new list that uses another position in memory? ok, ...
abccba General Coding Help 6 3,426 Apr-08-2020, 02:44 PM
    Thread: local/global variables in functions
Post: RE: local/global variables in functions

(Apr-08-2020, 01:59 PM)stullis Wrote: This isn't a matter of global versus local. Rather, it's a matter of Python's sequence implementation. Sequences, such as a list, store values by reference to a...
abccba General Coding Help 6 3,426 Apr-08-2020, 02:14 PM
    Thread: local/global variables in functions
Post: local/global variables in functions

x = 1 def f1(y): y += 1 return y x1 = f1(x) print('x = ', x, ' x1 = ', x1)answer: x = 1 x1 = 2 x_list = ['1','2'] def f2(y_list): y_list[0] = '0' return y_list x1_list = f...
abccba General Coding Help 6 3,426 Apr-08-2020, 01:49 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020