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

More Books

Students also viewed these Databases questions

Question

Define promotion.

Answered: 1 week ago

Question

Write a note on transfer policy.

Answered: 1 week ago

Question

Discuss about training and development in India?

Answered: 1 week ago

Question

Explain the various techniques of training and development.

Answered: 1 week ago