You have problems with scopes of variables.
Taking in the thing
as a variable inside your function isn't any useful here as it can't be changed just by calling any function until you specifically define the function to change only the value of thing
.
You can define it in one way as:
thing = "string"
def my_func():
global thing #As thing has a global scope you have to tell python to modify it globally
thing = input("Type something:")
>>>my_func()
>>>Type something: hello world
>>>print(thing)
>>>'Hello world'
But the above method will only work for the thing
variable. And not on any other variables passed to it, but a function like below will work on everything.
thing = "string"
def my_func():
a = input("Type something."))
return a
>>>thing = my_func()
>>>Type something: Hello world
>>>print(thing)
>>>'Hello world'