= int(len(numbers) / 2)
del numbers[i]
print("n={} , del={} , {}".format(n, i, numbers))
in this Program why i have only n = 0,1,2,3,8 but i have not n = 4,5,6,7,9 ?
because the size of your list is changing when you delete an item from it inside the loop
When n=3 the size of my list is 6 It means n should equal to 4
no, look n is an item of the list, n is not an index
Обсуждают сегодня