Hi, I am trying to learn programming and python and one of the books I use has an exercise for "Bounded Linear Search algorithm" under the heading in Accumulating Unique Values at <http://homepage.mac.com/s_lott/books/nonprog/html/p08_sequence/p08_c04_list.html#list- exercises>
I have coded the exercises as below and what I can not figure it out is the code works along as spin[0] and spine[-1] are not same but when it is the code does not work. What am I missing ? spin=[18, 10, 2, 19, 20, 10, 2, 7, 26, 10,2,2,18] uniq=[] for v in spin: i=0 uniq.append(v) while uniq[i]!=v: i+=1 if uniq[i]==v: if i!=len(uniq)-1: uniq.pop(-1) print(uniq) Thanks Togan _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor