📅  最后修改于: 2022-03-11 14:46:25.775000             🧑  作者: Mango
# for accessing a variable from outside the function then create that variable
# as an attribute of the function
def hi():
# other code...
hi.bye = 42 # Create function attribute.
sigh = 10
hi()
print(hi.bye) # -> 42