Trouble Using Function In Python
Hey guys, I have a question that I am a list of numbers and I need to use functions to find the average. I think I pretty much have it, but I can not get it to print the average. C
Solution 1:
Have you tried print average(nums)
? The code you have so far is just defining the function. It isn't doing anything with it. You have to call the function with its parameters and then do something with its return value (i.e. use the print
function).
Post a Comment for "Trouble Using Function In Python"