UPSC Exam  >  UPSC Questions  >  Write a program in Python to input three numb... Start Learning for Free
Write a program in Python to input three numbers and find their average?
Most Upvoted Answer
Write a program in Python to input three numbers and find their averag...
Program to Find Average of Three Numbers in Python

Step 1: Input
- Start by taking input from the user for three numbers. You can use the input() function in Python to do this.

Step 2: Calculating Average
- Add the three numbers together and then divide the sum by 3 to find the average. You can use the following formula:
average = (number1 + number2 + number3) / 3

Step 3: Displaying the Result
- Print out the average calculated in the previous step using the print() function.

Example Code:
python
# Taking input from the user
number1 = float(input("Enter the first number: "))
number2 = float(input("Enter the second number: "))
number3 = float(input("Enter the third number: "))
# Calculating the average
average = (number1 + number2 + number3) / 3
# Displaying the result
print("The average of the three numbers is:", average)

Output:
Enter the first number: 10
Enter the second number: 20
Enter the third number: 30
The average of the three numbers is: 20.0
By following these steps, you can easily input three numbers in Python and find their average. This program can be useful in various mathematical calculations where finding the average of a set of numbers is required.
Explore Courses for UPSC exam

Top Courses for UPSC

Write a program in Python to input three numbers and find their average?
Question Description
Write a program in Python to input three numbers and find their average? for UPSC 2024 is part of UPSC preparation. The Question and answers have been prepared according to the UPSC exam syllabus. Information about Write a program in Python to input three numbers and find their average? covers all topics & solutions for UPSC 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Write a program in Python to input three numbers and find their average?.
Solutions for Write a program in Python to input three numbers and find their average? in English & in Hindi are available as part of our courses for UPSC. Download more important topics, notes, lectures and mock test series for UPSC Exam by signing up for free.
Here you can find the meaning of Write a program in Python to input three numbers and find their average? defined & explained in the simplest way possible. Besides giving the explanation of Write a program in Python to input three numbers and find their average?, a detailed solution for Write a program in Python to input three numbers and find their average? has been provided alongside types of Write a program in Python to input three numbers and find their average? theory, EduRev gives you an ample number of questions to practice Write a program in Python to input three numbers and find their average? tests, examples and also practice UPSC tests.
Explore Courses for UPSC exam

Top Courses for UPSC

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev