could you explain to me in detail the second half of program? I understand input_list[0] = 10 is a variable where it has a range of 1 - 10, but where did the list [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
, [10, 2, 3, 4, 5, 6, 7, 8, 9]
, and [10, 5, 5]
come from?
def list_changer(input_list):
input_list[0] = 10
input_list = range(1, 10)
print(input_list)
input_list[0] = 10
print(input_list)
>>> test_list = [5, 5, 5]
>>> list_changer(test_list)
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[10, 2, 3, 4, 5, 6, 7, 8, 9]
>>> print test_list
[10, 5, 5]
Thank you in advance for all of your help.