I utilized the above code to reverse a list yet I was asking for what reason is the range(len(my_list)) vital, all the more explicitly, for what reason doesn't it work in the event that I basically "for i in my_list:"?
my_list=[1,2,3,4,5]
new_list=[]
for i in range(len(my_list)):
new_list.insert(i,my_list[-1])
my_list.pop(-1)