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
According to Google data, among consumers who conduct a local search on their smartphone, how many then visit a store within a d
sertanlavr [38]

Answer:

According to the google data, 50% consumers visited a store when they conduct a local search on their smartphones within a day.

And consumers more than 60% range uses location data in the advertisements. They uses store location and phone number through the advisement on smartphones and laptop.  

More than 34% of consumers search on the laptops and computer are visited to a store within a day.

8 0
3 years ago
Deliverable mean in an easy way​
alekssr [168]

Answer:

Deliverable means to send something or deliver something important like a file or a document.

Hope this helps...!

Explanation:

7 0
4 years ago
What type of memory disappears when you turn your computer off? CPU, RAM, ROM or Storage​
AlekseyPX

Answer:

RAM

Explanation:

8 0
3 years ago
Read 2 more answers
A(n) _______ is a distributed networking architecture, residing on one or more computers, where one program requests a resource
vova2212 [387]

Answer: Client-Server model

Explanation:

The Client-server model is a distributed network application configuration, that partitions task or where one program requests a resource or service from another program, between the providers of a resource or service, called servers, and service requesters called clients. In the client-server architecture, when the client computer sends a request for data to the server through the internet, the server accepts the requested process and deliver the data packets requested back to the client.

4 0
3 years ago
What is the output for the code below?
alisha [4.7K]
What is output by the code below? int[] array = {33,14,37,11,27,4,6,2,6,7}; System .out.println(array.length); ... int[] array = {5,10,3,6,9,15}; ... int total = 0; ... output by the code below? int j=1, tally=0; while(j<9) { tally++; j++; } System.out.print(tally);.
From quizlet
5 0
3 years ago
Other questions:
  • Meadowdale Dairy Farm sells organic brown eggs to local customers. It charges $3.25 for a dozen eggs, or 45 cents for individual
    6·1 answer
  • When was the federal commission act put into effect?????
    13·1 answer
  • Eliza needs to share contact information with another user, but she wants to include only certain information in the contact. Wh
    7·1 answer
  • Draw directed graphs representing relations of the following types.
    6·1 answer
  • Adios brainly, you were sh.t sometimes, but you had your moments, wont be posting that much take my points away i d c
    6·2 answers
  • Choose ALL guidelines listed below pertaining to fair use.
    12·2 answers
  • PLEASE HELP!!! NO LINKS!! I'LL GIVE BRAINLIEST!!
    12·2 answers
  • 1. What is the difference between background sound and nat sound
    15·1 answer
  • Which web source citations are formatted correctly? check all that apply.
    14·1 answer
  • Word frequencies - functions
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!