I have one function load
def load():
file = open((input("File name: ")), "r")
movies_list = file.readlines()
movies_list = [movie.strip() for movie in movies_list]
file.close()
And I want to use the list movies_list
in another function randomSelection
def randomSelection():
print(random.choice(movies_list))
How can I get around this? Is there a way to declare movies_list
as a global variable?