Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create your own function that calculate the maximum and minimum of two numbers. Then compare the results with Python's built-in functions max() and min().
Create your own function that calculate the maximum and minimum of two numbers. Then compare the results with Python's built-in functions max() and min(). 1. Define a function called own_max () which calculates the maximum of the integers a and b. It is possible to calculate without if with this formula: (la - b| means the absolute value of a - b) The function should return an integer. 2. Define a function called own_min ( ) which calculates the maximum of the integers a and b according to the formula: The function should return an integer. 3. Ask the user for two numbers and then print out the result of own_max ( ), max ( ), own min (), min () on the numbers. Leave a blank line after the input and between the maximum and minimum result. Number 1: 39 Number 2: 14 CODE SHOULD PRINT OUT LIKE THIS: own_max (39, 14) = 39 max (39, 14) 39 a + b +la-bl 2 = own min (39, 14) = 14 min (39, 14) 14 a+b-la-bl 2 =
Step by Step Solution
★★★★★
3.38 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
Sure here is the code for the three functions Python ...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