Question 2: Calculating Average Grade – Python MCQ

This is a simple question on basic arithmetic, list manipulation, and function implementation in Python.

What will be the output of the following code:

def calculate_average(numbers):
    total = sum(numbers)
    average = total / len(numbers)
    return average
marks = [85, 90, 92, 88, 95]
average_grade = calculate_average(marks)
print(average_grade)

Select an option:🤔🧐















B: is the correct answer.

This is because the division '/' operator provides the answer in a floating-point number. So, when the sum of marks (450) is divided by the total no. of marks available (5), the output is given 90.0.

Leave a Reply

This Post Has 10 Comments

  1. app

    What’s up to every body, it’s my first pay a visit of this web site; this blog includes amazing and truly excellent
    data designed for visitors.

  2. xyz

    A person necessarily lend a hand to make significantly posts I’d state.
    This is the first time I frequented your website page and so far?
    I surprised with the research you made to create this actual post incredible.
    Excellent task!

  3. Maitry

    Thank you so much for your kind words… Stay tuned…

  4. Maitry

    Thanks a lot… Stay tuned…

  5. Ins

    Bel article, je l’ai partagé avec mes amis.

  6. b usa fe

    I think this is one of the most important info for me. And i’m glad reading your article.
    But want to remark on some general things, The website style is perfect, the articles is
    really nice : D. Good job, cheers

  7. Maitry

    Thanks a lot!!

  8. Maitry

    Thanks a lot!!(merci beaucoup)

  9. how

    Hey there, I think your blog might be having browser compatibility issues.
    When I look at your website in Safari, it looks fine but when opening in Internet Explorer,
    it has some overlapping. I just wanted to give you a quick heads up!
    Other then that, great blog!

  10. Maitry

    Thanks a lot for bringing that to my notice will try to fix that soon… Stay tuned…