1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jok3333 [9.3K]
3 years ago
14

create your own min function that finds the minimum element in a list and use it in a separate function

Computers and Technology
1 answer:
schepotkina [342]3 years ago
5 0

Answer:

def minfunction(mylist):

   min = mylist[0]

   for i in mylist:

       if i < min:

           min = i

   print("The minimum is: "+str(min))

   

def anotherfunction():

   mylist = []

   n = int(input("Length of list: "))

   for i in range(n):

       listelement = int(input(": "))

       mylist.append(listelement)

   minfunction(mylist)

   

anotherfunction()

Explanation:

This solution is implemented in Python

This defines the min function

def minfunction(mylist):

This initializes the minimum element to the first index element

   min = mylist[0]

This iterates through the list

   for i in mylist:

This checks for the minimum

       if i < min:

... and assigns the minimum to variable min

           min = i

This prints the minimum element

   print("The minimum is: "+str(min))

   

This defines a separate function. This  separate function is used to input items into the list

def anotherfunction():

This defines an empty list

   mylist = []

This prompts user for length of list

   n = int(input("Length of list: "))

The following iteration inputs elements into the list

<em>    for i in range(n):</em>

<em>        listelement = int(input(": "))</em>

<em>        mylist.append(listelement)</em>

This calls the minimum function

   minfunction(mylist)

   

The main starts here and this calls the separate function

anotherfunction()

You might be interested in
​In sql server, the cursor property ____________________ means that the cursor is used for retrieval purposes only.
enyata [817]
I have recently found this answer https://assignment.essayshark.com/blog/sql-simple-examples-database/. Then provided me with a ready assignment in a very short period of time.

5 0
3 years ago
Cloud suites are stored on your hard drive and are available anywhere you can access the Internet
puteri [66]
Is that a question or an answer... im confused?!?!

5 0
3 years ago
Constructors have the same name as the ____.1. data members2. member methods3. class4. package
Svetradugi [14.3K]

Answer:

(3) option is the correct answer.

Explanation:

Constructors need to initialize the object in the memory. "To declare the Constructor for any class the user needs to specify the constructor name which is already the class name". This is an object-oriented language guideline.

It is because the object is created by the name of the class and Constructor is used to allocate the memory for the object. hence Constructor is created by the name of the class.

For example--

                       class test //class name test

                      {

                               test() //created a constructor with class name "test"

                               {

                               }

                      }

In the above example class name and constructor name are same if it not then it will gives a error.

Another option is not valid for the answer to the above problem because-

  • Option 1 is wrong because, for any class, the data member is a type of variable, which is used to store the data and is accessed with the help of an object.
  • Option 2 is wrong because, for any class, member function is a type of user function used to accessed the variable and expressions.
  • Option 4 is wrong because, package is a set used to hold classes and interfaces.

8 0
3 years ago
.The __________ comes in handy when I'm using Microsoft Word to type an essay with a specific word number requirement
mihalych1998 [28]

Answer:

character count

Explanation:

The answer is probably character count.

6 0
3 years ago
What are the advantages of mine shaft gear and the disadvantaged​
romanna [79]

Answer:

One sheave means that you are using a single drum winder. They are the worst! Double drum winders control easier, brake better and are much more efficient. They save time ( two skips or cages) and can be clutched to perform faster shift transport. A single drum is slow, unbalanced and can be a nightmare if it trips out during hoisting. If the brake system is not perfect it can be a real hairy experience. For a runaway single drum, there is no counterbalance effect. It always runs to destruction. With a double drum, the driver still has a chance to control the winder to a certain extent and he has two sets of brakes to rely on. A single sheave could also mean a shaft with a single compartment. No second means of escape unless there are ladders or stairways. Not a very healthy situation.

Those are just a few points. I am sure much more can be said in favor of a double drum winder and two or more sheaves in the headgear. Most of the shafts I have worked at have multiple winders and up to ten compartments. They all have a small single drum service winder for emergencies and moves of personnel during shift times. They are referred to as the Mary - Annes. Apparently, the name originated in the U.K. where an aristocratic mine owner named the first such winder after his mistress.

Explanation:

<em>Hope you got it </em>

<em>If you have any question just ask me</em>

<em>If you think this is the best answer please mark me as BRAINLIEST</em>

5 0
3 years ago
Other questions:
  • Which data type stores images and audio visual clips?
    9·2 answers
  • Search the internet for news of a motor vehicle collision in your community involving drugs or alcohol. Keeping in mind that you
    8·1 answer
  • What kind of java program runs within a java-enabled browser?
    15·1 answer
  • What's one way to engage teens in technology?
    8·1 answer
  • What should be included as part of the approval process? in relation to computer forensics
    14·1 answer
  • What is the answer 11100+01010​
    8·1 answer
  • What is the BCC feature used for?
    12·2 answers
  • Es costoso construir un robot
    6·1 answer
  • Write an enhanced for loop that multiplies all elements in an int[] array named factors, accumulating the result in a variable n
    11·1 answer
  • ! (( i &gt; ( f + 1)) es verdadero o falso segun la logica de programación.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!