Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. mylist = [1,1,2,3,4,5,2,6,2]
  2.  
  3. type(mylist)
  4. <class 'list'>
  5.  
  6. mylist2 = filter(lambda x: x == 2, mylist)
  7.  
  8. type(mylist2)
  9. <class 'filter'>
  10.  
  11. list(mylist2)
  12.  
  13. [2, 2, 2]
  14.  
  15. list(mylist2)
  16.  
  17. []
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement