217k views
5 votes
Assign the average of the values in the variables a, b, and c to a variable avg. Assume that the variables a, b, and c have already been assigned a value, but do not assume that the values are all floating-point. The average should be a floating-point value.

Use Python

1 Answer

5 votes

Answer:

avg = (a+b+c)/3

Step-by-step explanation:

Since we know that a, b, and c have values, we need to sum all the values, then divide this sum by the number of values you have to get the average.

1. Find out the sum of all three numbers

2. Divide this sum by 3 (Since we have three values)

3. Finally, assign the result to the variable avg

User Gokulan P H
by
3.4k points