When I try and use the code below, even when I run the set_list_index function it doesn't change the list_index variable. I.E. I pass it a 2 and list_index stays as a 0. I don't understand why it is failing to make this change, but it seems like it is failing to recognize the list_index variable because it is not within the function?
list = ["adam", "bob", "carmen"]
list_index = 0
def useful_function_1():
print(1)
def set_list_index(num):
list_index == num
def refers_to_list(num):
print(list[num])
def print_list_index():
print(list[list_index])
set_list_index(2)
print_list_index()