vivaladiva

Untitled

Oct 27th, 2020
826
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3.  
  4. # Removes negative numbers from the list
  5. def removeNegatives(listOfIntegers):
  6.     return filter(lambda x: x >= 0, listOfIntegers)
  7.  
  8. # Test
  9. print(removeNegatives([0, -1, -5, 2, 3]))
RAW Paste Data