def function(n):
if n % 2 != 0:
print('weird')
elif n % 2 == 0 and n in range(2, 5):
print('not weird')
elif n % 2 == 0 and n in range(6, 20):
print('weird')
elif n % 2 == 0 and n > 20:
print('not weird')
return n
# while True:
# n = int(input('enter the number: '))
# function(n)
import unittest
class Test_function(unittest.TestCase):
def test_function(self):
self.assertEqual(function(2), 'not weird')
I'm trying to test the code while executing the code nothing is showing in output. This is the way of writing code to test code? can anyone suggest how to write unit test code?