Code: Alles auswählen
from __future__ import print_function
solution = [1, 2, 3]
def spam():
global solution
arg = [42]
if len(arg) < len(solution):
solution = arg
print(arg)
def main():
print('solution before:', solution)
spam()
print('solution after:', solution)
if __name__ == '__main__':
main()
Code: Alles auswählen
solution before: [1, 2, 3]
[42]
solution after: [42]