Saturday, 14 September 2024

Practical - 56 - Write a Python Program which accepts three numbers from user and displays their sum and average.

Practical - 56 - Write a Python Program which accepts three numbers from user and displays their sum and average.


Ans:

a=int(input("Enter first number: "))

b=int(input("Enter second number: "))

c=int(input("Enter third number: "))

sum=a+b+c

avg=sum/3

print("Sum=",sum)

print("Average=",avg)

 

Output:

Enter first number: 8

Enter second number: 5

Enter third number: 11

Sum= 24

Average= 8.0


No comments:

Post a Comment