HOW TO DO A DOUBLE LOOP AND REMOVING THINGS FROM A LIST
I would like to learn about the double loop technics. i would like to compare some integers into a list by doing a double loop and deletings the values during the progression of the loop.
the more i will progress in my loop the more my list will be small
in order to avoid to be out of range i think we have to do a loop from the last index to the first. dont forget my main goal is to remore stuff from the list
...i just want to learn and i expect the code to work well
Replace this line with your code. list1=[["bread",5],["banana",34],["milk",16.5],["lettuce",22.5],["coco",22.5],["coke",34],["cheese",19],["honey",16.5],["apple",34]] for i in range(len(list1)): for j in list1[-1:i:]: if list1[i] < list1[i][j]: list1. print list1