Created
May 15, 2015 10:35
-
-
Save allankilpatrick/6a45bf521b5c692da911 to your computer and use it in GitHub Desktop.
ipdb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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