Open this example in the interactive library
Source code
def add(a, b):
return a + b
assert add(2, 3) == 5
print('Passed')Sample output
Passed

Check expected values with assertions. A self-contained example using the Python standard library.
Open this example in the interactive library
def add(a, b):
return a + b
assert add(2, 3) == 5
print('Passed')Passed