Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Managerial Accounting

Authors: Ray Garrison, Eric Noreen, Peter Brewer

15th edition

1259404781, 007802563X, 978-1259404788, 9780078025631, 978-0077522940

Students also viewed these Databases questions