Write a python program to calculate the average of five numbers passed by users using function.
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)}")
Comments
Leave a comment