1a
Write a function add(i, j) that returns the sum of two numbers. Replace the inline sum in the cell with a call to it. Put the function at the top of the cell, so it exists before the first call. Run the cell.
Hint 1
The slide Function Syntax shows the shape of def. The function needs a return, or the call gives back None.
Check your output
Add 7.0 and 2.0 : 9.0Show solutionHide solution
def add(i, j):
return i + j
f1 = 7.0
f2 = 2.0
addresult = add(f1, f2)
print(f"Add {f1} and {f2} : {addresult}")