You can read about definition and all other that theory in Python help, Just look at these example to make the points clear:
Using String (immutable):
Syntax:
def try_to_change_string_reference(the_string):
print('ST', the_string)
the_string = 'Devils in City'
print('Will', the_string)
outer_string = 'It happened for two days'
print('before, outer_string =', outer_string)
try_to_change_string_reference(outer_string)
print('after, outer_string =', outer_string)
Output:
before, outer_string = It happened for two days
ST It Happened for two days
Devils in the city
after, outer_string = It happened for two days
To know more about this you can have a look at the following video tutorial:-