davegimo

Untitled

May 27th, 2022
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. def filtra_ordinati(l1):
  2.  
  3. l2 = []
  4.  
  5. l2.append(l1[0])
  6.  
  7. for el in l1:
  8. if el > l2[-1]:
  9. l2.append(el)
  10.  
  11. return l2
  12.  
  13.  
  14.  
  15. l = [1,2,5,4,7,8,3,9]
  16. print(filtra_ordinati(l))
  17.  
Advertisement
Add Comment
Please, Sign In to add comment