Press ESC to close

How to find average of three numbers in python

Photo by Pixabay

Here’s a simple and easy-to-understand way to find the average of three numbers in Python:

# Define the three numbers
number1 = 5
number2 = 10
number3 = 15

# Calculate the sum of the numbers
total = number1 + number2 + number3

average = total / 3

# Print the result
print("The average of the three numbers is:", average)

Leave a Reply

Your email address will not be published. Required fields are marked *