Question

Write a function that takes, as arguments, three numbers, and returns their average. Round the values...

Write a function that takes, as arguments, three numbers, and returns their average. Round the values to the nearest tenth. Name this function calculate Average (p1, p2, p3). For example, >>>calculate Average (2.5, 3.5, 9)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

def calculateAverage(p1,p2,p3):
    avg = (p1+p2+p3)/3.0
    return round(avg)

# Testing
print(calculateAverage(2.5,3.5,9))

5

Add a comment
Know the answer?
Add Answer to:
Write a function that takes, as arguments, three numbers, and returns their average. Round the values...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT