Skip to content
CampusEduX

Problem 3: Average of a List Function

Easypython
Learn the Concept: Functions

Problem Description

Write a function calculate_average(numbers) that takes a list of numbers and returns their average.

Input

A list containing one or more numbers.

Output

A single number representing the average.

Constraints

  • The list will always contain at least one number.

Example Input

text
[10, 20, 30, 40]

Example Output

text
Average: 25.0

Concepts Covered

Functions, loops, lists, return, arithmetic operations.

Related Problems

  • Problem 1: Simple Interest Calculator Function
    Easy · python
    Solve Problem
  • Problem 2: Even or Odd Checker Function
    Easy · python
    Solve Problem
  • Problem 4: Greeting Function with Default Argument
    Easy · python
    Solve Problem

Input (stdin)

Output

Run your code to see output here...