This code is supposed to reverse the first
number items in
my_list, while keeping the remainder of the list in its original order.
list_copy=i=0j=number - 1while i < number or j >=0:list_copy[i]=my_list[j]i +=1j -=1for i in range(number,length(my_list)):list_copy[i]=my_list[i]
I've used pen & paper to run the iterations and can't figure out why I'm getting "list assignment index out of range". What am I missing?