elcocodrilotito

1.4 (malo)

Feb 15th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. #Daniel Bedialauneta
  2. def funcion(l):
  3.     i=0
  4.     while i<=len(l)-1:
  5.         if l.count(l[i])==1:
  6.             del l[i]
  7.         else:
  8.             i+=1
  9.     i=0
  10.     while i<=len(l)-1:
  11.         veces=l.count(l[i])
  12.         if veces>1:
  13.             for j in range(veces-1):
  14.                 l.remove(l[i])
  15.         else:
  16.             i+=1
  17.     return l
  18. print(funcion([1,0,3,4,1,2,3,9,1]))
Add Comment
Please, Sign In to add comment