← 返回 waymo 的题目列表Average Function
类型:online_judge
Problem: Average Function
Implement:
def average(table):
table is a list of numbers. Return its arithmetic mean, or return 0 when the list is empty.
Examples:
average([1, 2, 3]) # 2.0
average([]) # 0
Example
Input
1 2 3
Output
2.0