Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- # Removes negative numbers from the list
- def removeNegatives(listOfIntegers):
- return filter(lambda x: x >= 0, listOfIntegers)
- # Test
- print(removeNegatives([0, -1, -5, 2, 3]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement