Question: In Python , please create the functions fancy_min(a, b) and minimum_of(numbers) without using the built-in min() function. Also, follow the notes for specific requirements. 1)

 

In Python, please create the functions fancy_min(a, b) and minimum_of(numbers) without using the built-in min() function. Also, follow the notes for specific requirements.

1) fancy_min(a, b)

Input: two formal parameters: a and b

Output: return the minimum of a and b

Notes:

  • a and b can either be a number or None

  • if a is None, return b

  • if b is None, return a

  • if both are None, return None

  • otherwise return the minimum of a and b

  • do not use the built in function min()

2) minimum_of(numbers)

Input: numbers is a list of numbers (an item can be None as well)

Output: returns the minimum number in numbers.

Notes:

  • minimum_of MUST use the function fancy_min

  • you cannot use the Python min() function

  • if numbers is empty, return None

  • if numbers is None, return None

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!