A function packages a piece of work under a name, so you can run it again with different inputs:
def net_price(price, discount):
return price * (1 - discount)
def starts it, the names in parentheses are its arguments, and the indented block is the body. return hands a value back to whoever called the function, so net_price(80, 0.25) gives 60.0, which you can store, add up or print.
print() isn't the same as return. A function that prints shows you a number but hands back None, so total = net_price(80, 0.25) would store nothing useful. A function with no return at all returns None.
return also ends the function on the spot. A return inside a loop stops after the first pass, so put it after the loop, one indent to the left.
Good functions do one job and have a name that says what they give back.