Skip to content
C

Problem 2: Variance and Standard Deviation Calculator

Easypython

Problem Description

Write a Python program that calculates the variance and standard deviation of a list of numbers using NumPy, and prints both results rounded to 2 decimal places.

Input

A list of numbers.

Output

The variance and standard deviation, rounded to 2 decimal places.

Constraints

  • The list will contain at least 2 numbers.

Example Input

text
[10, 12, 23, 23, 16, 23, 21, 16]

Example Output

text
Variance: 24.11 Standard Deviation: 4.91

Concepts Covered

np.var(), np.std(), round().

Input (stdin)

Output

Run your code to see output here...