fb pixel

Introduction to Python

  • Profound Academy

    • Status
      • 1
        Input and Output
      • 2
        Variables and Integer Arithmetic
      • 3
        Conditional Operators
      • 4
        Advanced Conditions - Nesting
      • 5
        Types and Variables
      • 6
        Strings
      • 7
        Lists
      • 8
        For Loops
      • 9
        While Loops
      • 10
        continue, break, while...else
      • 11
        String and List methods
      • 12
        Nested Loops
      • 13
        List Comprehension
      • 14
        Tuples and Sets
      • 15
        dict
      • 16
        Functions
      • 17
        Functions 2
      • 18
        Lambda and higher-order functions
      • 19
        Files

  • Average

    The company has n employees. Each employee gets a salary. The company is interested in their expenses and would like to understand what’s the average amount they’re spending per employee. They ask you to write a program that would provide them with that data.
    It is guaranteed that the number of employees is 5 ≤ n ≤ 8.
    The first line of the input contains the number of employees n. The next n lines contain their salaries.
    The program should print a single number - the average of the salaries.
    Input
    Output
    5 100 200 150 180 400
    206
    Tip
    You can read 5 inputs and then use an if statement to determine if reading more input is necessary and append it if more lines are present.
     
    To check your solution you need to sign in
    Sign in to continue