Computer Science, asked by vipisika, 1 year ago

write a python program to find the average of 4 number​

Answers

Answered by Anonymous
5

while True:

print("Enter 'x' for exit.")

print("Enter any 3 numbers to find average: ")

n1 = input()

n2 = input()

n3 = input()

if n1 == 'x':

break

else:

number1 = int(n1)

number2 = int(n2)

number3 = int(n3)

number4 = int(n4)

sum = number1 + number2 + number3  + number4

average = sum/34

print("Average of entered 4 numbers is ", average, "\n")


amannishad0512p5zxh6: but firstly accept my friendship
Anonymous: no never i will accept
amannishad0512p5zxh6: soo then keep going
amannishad0512p5zxh6: i disturb you
amannishad0512p5zxh6: like you disturb me
fiercespartan: There is a simple method
fiercespartan: print('The average of the four number is' sum(numbers)/4)
fiercespartan: That's it :)
Anonymous: but, it is more appropriate according to the question
Anonymous: thanks
Answered by sushiladevi4418
7

Answer:

Python program to find the average of four numbers.

Explanation:

##input the numbers

Num1=int(input("Enter Number 1:")

Num2=int(input("Enter Number 2:")

Num3=int(input("Enter Number 3:")

Num4=int(input("Enter Number 4:")

## Calculate average

Avg= (Num1+Num2+Num3+Num4)/4

print(avg)

Similar questions