Question: This week's reading (Severance, Chapter 4) discusses built in and user defined functions. This week's assignment is to define a function called 'maxOfThree' that takes

This week's reading (Severance, Chapter 4) discusses built in and user defined functions. This week's assignment is to define a function called 'maxOfThree' that takes three values and returns the maximum value of the three. Demonstrate that your function works properly by writing a Python script that requests three values from the user and then prints the maximum of the three values by calling your maxOfThree() function.

For example, my implementation looks like this at runtime:

Enter first value: 1

Enter second value: 2

Enter third value: 1

The maximum of 1 2 1 is 2

Be sure to test your program on different cases including:

1,2,3

3,2,1

2,1,3

1,1,3

a, b, c

And don't forget to check for exceptions that might arise with invalid inputs.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!