Finding the Average of three numbers in Python

calculating the average of three numbers

Source code :


a = int(raw_input("Enter a value : "))        # value 1

b = int(raw_input("Enter b value : "))        # value 2

c = int(raw_input("Enter c value : "))        # value 3
   
# Calculating the  average

average = (a + b + c) / 3

# Printing the average

print ("The average is: " + str(average))



Output :

Enter value a : 1
Enter value b : 2
Enter value c : 3
The average is: 2.0

Output :


                

Comments :