22 lines
376 B
Python
22 lines
376 B
Python
"""
|
|
This is some really Fancy Math!
|
|
"""
|
|
|
|
def add(x1, x2):
|
|
"Apply the + operator to two Python objects"
|
|
return x1 + x2
|
|
|
|
|
|
def fact(n: int) -> int:
|
|
"Return the factorial of n."
|
|
if n == 1:
|
|
return 1
|
|
else:
|
|
return n * fact(n - 1)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
n = 5
|
|
assert fact(n) == 120
|
|
assert add(5, 6) == 11
|
|
print("Tests passed") |