If you want a value from a function the clearest and most standard way to do it is to return the value:
def ask_name():
name = input("what is your name?")
return name # this gives the value back to the calling function
def another_function():
name = ask_name() # this assigns the returned value to the variable "name"
print(name)
Also, don't define functions with the same name as built-in functions like print():
def print(name_to_print):
print(name_to_print)
If you call this function it will not print anything. Rather, when it calls print(name_to_print) it will call itself, not the built-in print(). Then that will call it self again over and over again until your program fails with the error "RecursionError: maximum recursion depth exceeded".