Python programming about list -


this question has answer here:

in program want remove duplicate values list. wrote:

list = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]  def loop():     in range(len(list)-1):         b in range(a+1,len(list)):             if list[a] == list[b]:                 del list[a]     print(list)   loop() 

but, it's giving me error:

enter image description here

can me?

if have numpy can (i renamed list l avoid ambiguity):

import numpy np  l = [1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89] l_no_duplicates = list( np.unique(l) ) 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -