satya

Tuesday, September 1, 2020

Program 2

                                                                         Program2

Write a program that asks the user to enter three numbers (use three separate input statements). Create variables called total and average that hold the sum and average of the three numbers and print out the values of total and average.

Program:


number1=int(input("enter the number1:"))

number2=int(input("enter the number2:"))

number3=int(input("enter the number3:"))

Total=number1+number2+number3

avg=Total/3

print("Total=",Total)

print("Average=",avg)



Output:
enter the number1:20
enter the number2:60
enter the number3:70
Total= 150
Average= 50.0

No comments:

Post a Comment

Program 30

                                                                         Program 30 Write a Python class to implement pow(x, n). class Pow1:...