What happens if you do:
def learn_how_to_greet(formal=True):
if formal:
string = "Good day, Mr. {last_name}."
else:
string = "What's up, {first_name}?"
def greet(**kwds):
return string.format(**kwds)
ret = greet
string = "WHOA! Look at me!"
return ret
In other words, at what point do the variables used in the "greet" function get saved off? And what is saved, the variable name itself, or the data in it?