To pass by reference or by copy of - that is the question from hamlet. ("hamlet" - a community of people smaller than a village python3.4-linux64) xlist = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] i = 0 for x in xlist: print(xlist) print("\txlist[%d] = %d" % (i, x)) if x%2 == 0 : xlist.remove(x) print(xlist, "\n\n") i = i + 1 So, catch the output and help me, PLEASE, improve the answer: Does it appropriate ALWAYS REevaluate the terms of the expression list in FOR-scope on each iteration? But if I want to pass ONCE a copy to FOR instead of a reference (as seen from an output) and reduce unreasonable reevaluation, what I must to do for that?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4