हिंदी

Write a program to find the average of three numbers. - Computer Science (Python)

Advertisements
Advertisements

प्रश्न

Write a program to find the average of three numbers.

संक्षेप में उत्तर

उत्तर

Program:
#defining three variables
a = 5
b = 6
c = 7

#calculating average using the formula, average = (sum of variables)/(number of variables)
average = (a + b + c)/3

#print the result
print("The average of",a,b,"and",c,"is",average)

OUTPUT:
The average of 5 6 and 7 is 6.0
shaalaa.com
Number
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 5: Getting Started with Python - Exercise [पृष्ठ ११८]

APPEARS IN

एनसीईआरटी Computer Science [English] Class 11
अध्याय 5 Getting Started with Python
Exercise | Q 17. | पृष्ठ ११८
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×