so I've started learning python again and I'm currently making a mini movie-recommendator. I want my code to be a little bit more understandable so I'm always trying to use def to make the code simple. My problem is ;
def welcome():
print("""Welcome to the low budget film recommender!
Here you can tell me what kind of movies do you like or what movie did you watch
and I'll suggest you a movie from my database according to that.""")
name = input("But first I need to learn your name:>> ").capitalize()
print(f"Nice to meet you {name}")
return name
I want to use the name variable outside of the function(inside another function actually) but it gives me NameError and says "name" is not defined. How can I fix this and use the name variable outside of the function?