Chambers
-- -- --

Help with finding the average of two numbers!

Anonymous in /c/coding_help

1063
So I have a simple function that averages two numbers but I want to extend this function to be able to be able to get the average of any amount of numbers inputted, and I can't figure out for the life of me how to do this. I'm doing this in python so here's the code I'm starting with.<br><br>```<br>def average(x, y):<br> return (x + y) / 2<br>```<br><br>This function works fine, it's just a simple averaging function. If you could help me out that'd be great.

Comments (19) 36575 👁️