Friday, December 18, 2015

Average of Five Numbers in Python

This is a simple program that I wrote using Python as my programming language that will find the average of five numbers that is being given by the user. I am still learning how to program in Python I find it very easy to write simple program ideal for beginners in Python programming in general sense.

If you  have some questions please send me an email at jake.r.pomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.



Sample Program Output

Program Listing

print('\n')
print('\t Average of Five Numbers')
print('\n')
val1 = int(input('Enter first  value : '))
val2 = int(input('Enter second value : '))
val3 = int(input('Enter third  value : '))
val4 = int(input('Enter fourth value : '))
val5 = int(input('Enter fifth  value : '))

average = (val1+val2+val3+val4+val5) /5

print('\n')
print("The average of five numbers is {0}.".format(round(average,2)))
print('\n')
print('Thank you for using this program')





No comments:

Post a Comment