Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone help me write a code? Use the Min/Max pattern to write the function minimum function. This function consumes a list of numbers and
Can someone help me write a code? Use the Min/Max pattern to write the function minimum function. This function consumes a list of numbers and returns the lowest number in the list. Call the function on a list of numbers and print the result. I don't quite understand loops but I need to use one.
I'm assuming it would be something like this:
def minimum(a_list):
result = 0
for item in a_list:
if item < 100:
result = result + 1
print(result)
But I'm unsure how to alter the code so it takes the first number on the list
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