def add(a, b):
return a + bLine-by-line explanation
- The function receives two numbers.
- Return sends their sum back.
def test_add():
assert add(2, 3) == 5Line-by-line explanation
- The test function has a descriptive name.
add(2, 3)produces a result.== 5describes the expected value.assertreports failure when the comparison is False.