Skip to content

Instantly share code, notes, and snippets.

@imShakil
Last active August 10, 2020 09:36
Show Gist options
  • Save imShakil/a25cb22b0f328794c23e9fe0c6a6bf79 to your computer and use it in GitHub Desktop.
Save imShakil/a25cb22b0f328794c23e9fe0c6a6bf79 to your computer and use it in GitHub Desktop.
import unittest
def square_items(list_of_number):
return [item ** 2 for item in list_of_number]
class TestUnitTest(unittest.TestCase):
def test_square_items(self):
self.assertEqual(square_items([1, 2, 3, 4]), [1, 4, 9, 16])
if __name__ == "__main__":
unittest.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment