Skip to content

Instantly share code, notes, and snippets.

@allankilpatrick
Created May 15, 2015 10:35
Show Gist options
  • Select an option

  • Save allankilpatrick/6a45bf521b5c692da911 to your computer and use it in GitHub Desktop.

Select an option

Save allankilpatrick/6a45bf521b5c692da911 to your computer and use it in GitHub Desktop.
ipdb
import unittest
def remove_even_numbers():
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for item in my_list:
if item % 2:
my_list.remove(item)
return my_list
class RunTests(unittest.TestCase):
def test_get_odd_numbers(self):
odd_numbers = remove_even_numbers()
self.assertEqual(len(odd_numbers), 5 )
if __name__ == "__main__":
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment