Firstly, I'm only a beginner, so please forgive me. I have one question asking " Define a function called avg. It asks the user for three numbers and prints their average." Then another question asking "Define a function called avg4. It asks the user for four numbers and returns the average of four numbers"
I would just like to know if this is a trick question? Because from my understanding, 'print' prints the output in the console, whereas 'return' is part of a function and doesn't actually have any output in the console.
Here is my code for the first question, what would be the difference for the second question? (aside from the four numbers instead of three)
def avg(a, b, c):
sum = (a+b+c)/3
return sum
a1 = avg(float(input("First number: ")), float(input("Second number: ")), float(input("Third number: ")))