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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started