Write function called evaluate() that evaluates the following Python expressions or assignments as specified: Request input from the user for three
View the step-by-step solution to:

Question

Write function called evaluate() that evaluates the following Python expressions or

assignments as specified:

  1. Request input from the user for three variables (floating-point or integer) x, y, z, and myAverage.
  2. If the average of the first three numbers equals the fourth number, print 'Your average is correct.'. If not print 'Your average is not correct'. and print the correct average.
  3. Print the largest value among x, y, and z.
  4. Print the minimum value of x, y, y.

 

>>> evaluate()

Enter a number for x: 3

Enter a number for y: 3

Enter a number for z: 4.5

You have entered x = 3 , y = 3 , z = 4.5

Enter what you think the average of x, y, and z is: 3.5

Your average is correct.

The maximum value of x, y, and z = 4.5

The min value of x, y, and z = 3

>>> evaluate()

Enter a number for x: 3

Enter a number for y: 3

Enter a number for z: 4

You have entered x = 3 , y = 3 , z = 4

Enter what you think the average of x, y, and z is: 4.5

Your average is not correct

   The correct average is: 3.3333333333333335

The maximum value of x, y, and z = 4

The min value of x, y, and z = 3

Top Answer

View the full answer
Capture.PNG

Sign up to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question