Get Python Average

Asked 2 years ago, Updated 2 years ago, 20 views

Complete the function to return the average value of the parameter list. The average value should be available for any size list.

Where is the error?

def average(list):

result =  sum(list) / len(list)

return result

list = [5,3,6] print("Average value: {}".format(average(list)))

Error!

python

2022-09-22 19:23

1 Answers

https://programmers.co.kr/learn/challenge_codes/128

Are you talking about here?

The message that there's no main came out I'm guessing you chose Java instead of Python.

Select the language Python in the upper right corner and submit the code.


2022-09-22 19:23

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.