I'm starting the basics with , and I didn't get how to update a global variable. The code is:
def spam():
global eggs
eggs='spam'
def update_eggs():
global eggs;eggs='global'
print(eggs)
I wanted to overwrite the "eggs" variable set as "spam" by "global", and I tried the methods in this post: Overwrite global var in one line in Python? But it didn't work. Could you advise please? Thank you in advance! Silvia