A local variable belongs to the function where it is created.
A function can use parameters and local names without replacing a same-named variable outside the function.
message = "Outside"
def show_message():
message = "Inside"
print(message)
show_message()
print(message)The inner message is local to show_message, so the outer message still has its original value.
Change one value or function call, then explain how the result changes.
Keep this in mind: Read the function definition and its calls before predicting the result.
message = "Outside"
def show_message():
message = "Inside"
print(message)
show_message()
print(message)Run the example, then change one value and observe the result.
