PRINT: Shows output, returns nothing
def add_print(a, b):
print(a + b)RETURN: Gives back a value to use
def add_return(a, b):
return a + bUsing them
result1 = add_print(5, 3) # Prints 8, result1 is None
result2 = add_return(5, 3) # result2 is 8
Key insight: Return when you need to use the result later!
Fix the calculate_tax function below. It currently prints the result but should return it so we can use it in further calculations.
Run your code to see output