Answer to Question #328693 in Python for Shubham

Question #328693

Write a python program to calculate the average of five numbers passed by users using function.


1
Expert's answer
2022-04-14T06:16:52-0400


def calculateAverage(n1,n2,n3,n4,n5):
    return (n1+n2+n3+n4+n5)/5.0 




n1=float(input("Enter number 1: "))
n2=float(input("Enter number 2: "))
n3=float(input("Enter number 3: "))
n4=float(input("Enter number 4: "))
n5=float(input("Enter number 5: "))
print(f"Average: {calculateAverage(n1,n2,n3,n4,n5)}")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS