DataLane

1. Mean

easyNot started~5 minPythonImplement arithmetic_mean()

Asked in screens shaped like: Google, Meta

← Prev1 / 33Next →

Given an array of numbers nums, compute the arithmetic mean (average). Return the mean rounded to 2 decimal places.

Examples

  • Example 1

    Input: { "nums": [-10, 5, -3, 8] }
    Output: 0

Constraints

  • 1 <= n <= 10**5, where n is the length of the input
  • Input is non-empty

Python editor

Loading Python engine…

Ctrl/Cmd + Enter submits

Run your code to see stdout.

↑↓ navigate openesc close