Learn about Python Program to Calculate the Average of 5 Numbers in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.
Python Program to Calculate the Average of 5 Numbers
# Python program to find average of five numbers num1 = 5 num2 = 10 num3 = 15 num4 = 20 num5 = 25 # calculate average of numbers avg = (num1 + num2 + num3 + num4 + num5) / 5 # print average print('The average of numbers = %0.2f' %avg)
The average of numbers = 15.00
Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.
Similar Code : Find the Average of 4 Numbers using Function in Python