Write a program which has your own versions of the Python built-in functions min and max. In other words, write the functions called maximum(aList) and minimum(aList) that do the job of the built-in Python functions max(aList) and min(aList)respectively. They should take a list as an argument and return the minimum or maximum element . Test your functions with the list [7, 5, 2, 3, 1, 8, 9, 4]. Hint: Pick the first element as the minimum (maximum) and then loop through the elements to find a smaller (larger) element. Each time you find a smaller (larger) element, update your minimum (maximum).

Answers

Answer 1

Answer:

def maximum(aList):

   highest = aList[0]

   for number in aList:

       if number > highest:

           highest = number

       

   return highest

def minimum(aList):

   lowest = aList[0]

   for number in aList:

       if number < lowest:

           lowest = number

       

   return lowest

print(maximum([7, 5, 2, 3, 1, 8, 9, 4]))

print(minimum([7, 5, 2, 3, 1, 8, 9, 4]))

Explanation:

Create a function named maximum that takes one parameter, aList

Initialize the highest as the first number in aList

Create a for loop that iterates through the aList. Compare each number in aList with highest. If a number is greater than highest, set it as new highest.

When the loop is done, return the highest

Create another function named minimum that takes one parameter, aList

Initialize the lowest as the first number in aList

Create a for loop that iterates through the aList. Compare each number in aList with lowest. If a number is smaller than lowest, set it as new lowest.

When the loop is done, return the lowest

Call the functions with given list and print the results


Related Questions

When turning on any circuit breaker , you should always stand A. At arm’s length from the load center
B.in front of the device
C. To the side of the load center
D . About two feet from the device

Answers

Answer:C. To the side of the load center

Explanation:


where must data be in
order to be processed by an
executing program. *
O A. Read Only Memory
O B. secondary storage device
O C. Random Access Memory
O D. hard disk​

Answers

Answer:

C Random access memory

Your workstation needs additional RJ-45 network connections. Which of the following changes do you implement to meet this need?

Answers

Answer:

Install a network interface card

Earth’s crust would be best modeled by using a material that is -

liquid and hot.
liquid and hot.

dense and smooth.
dense and smooth.

soft and flexible.
soft and flexible.

thin and solid.

Answers

Answer:

thin and solid

Explanation:

The "crust" is the outermost part of the Earth. It only accounts for a very small portion of the Earth's mass and that makes it thin. It is made up of different sands, rocks and minerals. This is the reason why it is solid and not liquid (nor is it soft and flexible). It's temperature is not that hot when compared to the inner core. It has the same temperature with the Earth's atmosphere. This allows humans to continue thriving on Earth.

Thin and solid! Hope this helped! BRANLIEST plz

wite a short essay recalling two instance, personal and academic, of when you used a word processing software specifically MS Word for personal use and academic work

Answers

I often use MS Word for personal and academic work. Its features improved productivity. One use of MS Word was to create a professional resume. MS Word offered formatting choices for my resume, like font styles, sizes, and colors, that I could personalize.

What is MS Word

The software's tools ensured error-free and polished work. Using MS Word, I made a standout resume. In school, I often used MS Word for assignments and research papers.

Software formatting aided adherence to academic guidelines. Inserting tables, images, and citations improved my academic work's presentation and clarity. MS Word's track changes feature was invaluable for collaborative work and feedback from professors.

Learn more about MS Word  from

https://brainly.com/question/20659068

#SPJ1

Read and answer the question.


The plant manager of the Maladroit Cosmetics Company must

replace several of her filling machines that have become obsolete. She is about to take delivery of six machines at a total cost

of $4 million. These machines must be installed and fully tested

in time to be used on a new production line scheduled to begin

operation in 6 months. Because this project is important, the

plant manager would like to devote as much time as possible to

the job, but she is currently handling several other projects. She

thinks she has three basic choices: (1) she can handle the project

informally out of her office; (2) she can assign the project to a

member of her staff; or (3) the company that manufactures the

machines can handle the installation project for a fee close to

what the installation would cost Maladroit.


Questions: Would you classify the work of installing the six machines as

a project? Why or why not? Explain how the PM might trade

off one of the primary objectives for another. What type of life

cycle would you envision the machine installation work would

follow? Why

Answers

Yes, the work of installing the six machines can be classified as a project. A project is a temporary endeavor with a defined beginning and end, undertaken to meet unique goals and objectives. The installation of the machines has a clear goal (to have the machines installed and fully tested), a defined timeline (in time for the new production line scheduled to begin operation in 6 months), and is unique to the specific needs of the Maladroit Cosmetics Company.

The plant manager might trade off one of the primary objectives for another by considering factors such as cost, time, and quality. For example, if time is of the essence, she might choose to pay a higher cost to have the machines installed more quickly. Alternatively, if cost is a major concern, she might choose to handle the project informally out of her office or assign it to a member of her staff, even if it takes longer to complete.

The machine installation work would likely follow a project life cycle that includes initiation, planning, execution, monitoring and controlling, and closing. This type of life cycle is common for projects that have a clear goal and defined timeline. During the initiation phase, the project would be formally defined and authorized. In the planning phase, the scope of the project would be determined and a plan for completing it would be developed. During execution, the plan would be put into action and the machines would be installed. The monitoring and controlling phase would involve tracking progress and making any necessary adjustments to keep the project on track. Finally, in the closing phase, the project would be completed and any final deliverables would be handed over.

Which part of the Result block should you evaluate to determine the needs met rating for that result

Answers

To know the "Needs Met" rating for a specific result in the Result block, you should evaluate the metadata section of that result.

What is the  Result block

The assessment of the metadata section is necessary to determine the rating of "Needs Met" for a particular outcome listed in the Result block.

The metadata includes a field called needs_met, which evaluates the level of satisfaction with the result in terms of meeting the user's requirements. The needs_met category usually has a score between zero and ten, with ten implying that the outcome entirely fulfills the user's demands.

Learn more about Result block from

https://brainly.com/question/14510310

#SPJ1

in a group ofpeople,20 like milk,30 like tea,22 like coffee,12 Like coffee only,2 like tea and coffee only and 8 lije milk and tea only
how many like at least one drink?​

Answers

In the given group of people, a total of 58 individuals like at least one drink.

To determine the number of people who like at least one drink, we need to consider the different combinations mentioned in the given information.

First, we add the number of people who like each drink separately: 20 people like milk, 30 people like tea, and 22 people like coffee. Adding these values together, we get 20 + 30 + 22 = 72.

Next, we need to subtract the overlapping groups. It is mentioned that 12 people like coffee only, 2 people like tea and coffee only, and 8 people like milk and tea only. To find the overlap, we add these three values: 12 + 2 + 8 = 22.

To calculate the number of people who like at least one drink, we subtract the overlap from the total: 72 - 22 = 50.

Therefore, in the given group, 58 individuals like at least one drink. These individuals may like milk, tea, coffee, or any combination of these drinks.

For more questions on group

https://brainly.com/question/32857201

#SPJ8

2.) Using Constants and Variables to create a Program (10 points)
You are going to write out a program below that will help calculate the total amount of money made per
week, based on a 5 day work week and making $8 per hour.
You will need to create (2) Constant variables
You will need to create (3) variables

Answers

Using Constants and Variables to create a Program is given below.

How to create the program

# Establish constant values

DAYS_PER_WEEK = 5

HOURLY_WAGE = 8

# Introduce changeable parameters

hours_worked = 0

daily_earnings = 0

total_earnings = 0

# Ask user regarding hours labored each day

for day in range(1, DAYS_PER_WEEK + 1):

   hours_worked = int(input(f"How many hours did you work on day {day}? "))

   daily_earnings = hours_worked * HOURLY_WAGE

   total_earnings += daily_earnings

# Display aggregate income for the week

print(f"You made a total of ${total_earnings} this week.")

Learn more about program on

https://brainly.com/question/26642771

#SPJ1

Describe how being a global citizen in the world of advanced technology can be beneficial to your success in meeting your personal, academic, and professional goals.

Answers

Answer:

well you could have more options of careers and more possibilities, online jobs can pay more and give more experience to the employees

What is the purpose of a computer network needs assessment? to evaluate how to move from the current status to the desired goal to determine what steps employees can take to increase company revenue to analyze which workers need more training to improve their performance to compare worker productivity

Answers

Answer:

to evaluate how to move from the current status to the desired goal

answer this question.




side-note if you want please sub to Braeden Eischen.

answer this question.side-note if you want please sub to Braeden Eischen.

Answers

Answer:

yes

Explanation:

Define a function FindLargestNum() with no parameters that reads integers from input until a negative integer is read. The function returns the largest of the integers read

Answers

The FindLargestNum program is an illustration of function; where its execution is done when its name is called or evoked

The function FindLargestNum

The FindLargestNum function written in Python, where comments are used to explain each action is as follows:

#Thie defines the FindLargestNum function

def FindLargestNum():

   #This gets the first input

   num = int(input())

   #This initializes the minimum value

   maxm = num

   #The following is repeated until the user enters a negative input

   while num >= 0:

       #This determines the largest input

       if num > maxm:

           maxm = num

       #This gets the another input

       num = int(input())

   #This prints the largest input

   print(maxm)

Read more about functions at:

https://brainly.com/question/24941798

What are some ways you can work with templates? Check all that apply.
A. creating a new template from scratch
B. scanning a template from a printed page
C. using many different templates in one document
D. using a preexisting template
E. modifying a preexisting template

Answers

What are some ways you can work with templates? Check all that apply.

Answer: (A,D,E) see picture below for help also.
What are some ways you can work with templates? Check all that apply.A. creating a new template from

Answer:

Look at the other answer that guy knows what he is talking about

Explanation:

Word can only print documents on one size of paper.

True or false

Answers

Answer:

False

Explanation:

You can always go in the document settings to change the layout and make the paper wider (landscape).

Layout > Orientation

Choose portrait or landscape

How does DNS help the internet scale. Explain with words and a diagram

Answers

Answer:

DNS is an Internet protocol used by computers, services or any resource connected to the network of networks. It has several uses, but the most important is to resolve the IP of the website or service that we use.

Explanation:

The use of new DNS as an alternative to those offered by an operator is a good way to improve the Internet connection in performance, security and other aspects.    

To make them work, there are DNS servers, dedicated computers that act as a means of intercommunication between us and the web pages that we want to visit. They have huge databases in which the relationships between domains and their respective IP addresses are registered. When we try to connect, for example, to a recognized web page, the request is sent to the DNS so that they "translate" or "resolve" that URL. The name of a web page is obviously a friendlier and easier to remember address than the real IP address than various numbers, which are what our computer and / or communications team understands and works with.  

How does DNS help the internet scale. Explain with words and a diagram

Aisha designed a web site for her school FBLA club and tested it to see how well it would resize on different systems and devices. What kind of design did Aisha use?


Mobile development
Readability
Responsive
Software

Answers

Answer: responsive

Explanation:

its called mobile responsivness and most good websites have it

complete the add repair method!
(Will give the brainiest)

complete the add repair method!(Will give the brainiest)

Answers

Answer:

Give three(3) difference between Dot-matrix printer and the Daisy-wheel printer

4. Why is the performance of a computer so dependent on a range of technologies such as semiconductor, magnetic, optical, chemical, and so on

Answers

It should be noted that the performance of a computer is dependent on them in order to meet the challenges hat are associated with the applications.

What is a computer?

A computer simply means an electronic machine that can be used to make one's work easier and faster.

The performance of a computer so dependent on a range of technologies such as semiconductor, magnetic, optical, chemical, etc. This is vital in order to meet the challenges that are associated with the activities in the real world environment.

Learn more about computers on:

https://brainly.com/question/24540334

how do you create 2 dimensional array with c++?

Answers

2 dimensional arrays in C++ are arrays that have 2 dimensions i.e. rows and columns

How to create the array?

To create a 2-dimensional array in C++, you make use of the following syntax

data_type array_name[rows][columns];

Assume the following parameters:

The data type of the array is integerThe array name is StudentsThe array has 10 rows and 20 columns.

The declaration of an array with the above properties would be:

int Students[10][20];

Read more about arrays at:

https://brainly.com/question/22364342

A value is always positioned in what way in a cell

Answers

Answer:

=MATCH() returns the position of a cell in a row or column. Combined, the two formulas can look up and return the value of a cell in a table based on vertical and horizontal criteria.

Assume variables SimpleWriter out and int n are already declared in each case. Write a while loop that printsA. All squares less than n. For example, if n is 100, print 0 1 4 9 16 25 36 49 64 81.B. All positive numbers that are divisible by 10 and less than n. For example, if n is 100, print 10 20 30 40 50 60 70 80 90C. All powers of two less than n. For example, if n is 100, print 1 2 4 8 16 32 64.

Answers

Answer:

This program has been written using JAVA. The code is written beloe:

// import library

import java.util.Scanner;

public category Main operate

public static void main(String[] args)

{

// scanner category

Scanner scan=new Scanner(System.in);

System.out.println("Enter Number:");

int n=scan.nextInt();

//All squares but n

System.out.println("All squares but n are: ");

int temp=0,square=0,i=0;

while(square

range

square=i*i;

if(square>=n)break;

System.out.print(square+" ");

i++;

}

//All positive numbers that are divisible by 10 but less than n

System.out.println(" ");

System.out.println(" ");

System.out.println("All positive numbers are divisible by 10 and less than n are: ");

i=1;

while(i

{

if(i%10==0)

System.out.print(i+" ");

if(i>=n)break;

i++;

}

System.out.println(" ");

System.out.println(" ");

System.out.println("All powers of 2 that are less than n are: ");

//All powers of 2 less than n

i=0;

while(i

mathematics.pow(2, i);

if(num_power

System.out.print(num_power+" ");

i++;

}

}

}

Explanation:

With SimpleWriter out and int n already declared in each case this program makes use of a while loop condition to satisfy the following;

1. All squares less than n

2. positive numbers that are divisible by 10 and less than n.

3. All powers of two less than n.

what number am i. i am less than 10 i am not a multiple of 2 i am a coposite

Answers

Answer: 9 is less than 10, it is odd (not a multiple of 2), and it is composite (since it has factors other than 1 and itself, namely 3). Therefore, the answer is 9.

The answer is nine because if you write all the numbers that are under ten you can see that 2, 4, 6, and, 8 are multiples of 2 so you can’t do that so then you gotta see which ones are composite which is nine because 1, 5, and 7 don’t have any more factors than for example 7 and 1.

Why do DB Designers write mission statements?

Answers

Why do DB Designers write mission statements?


Database designers write mission statements for a few reasons:

Clarify the Purpose: A mission statement helps to clarify the purpose of the database and the goals it's designed to achieve. It ensures that everyone involved in the design process is on the same page and has a clear understanding of what the database is intended to do.Provide Guidance: A mission statement provides guidance for making decisions throughout the database design process. When faced with design decisions, designers can refer to the mission statement to ensure that their decisions align with the overall purpose of the database.Communicate with Stakeholders: A mission statement can be shared with stakeholders to communicate the purpose and goals of the database. It helps stakeholders understand why the database is being designed and what benefits it will provide.Measure Success: A mission statement helps to measure the success of the database after it's implemented. By comparing the actual results with the stated goals in the mission statement, designers can determine whether the database is meeting its intended purpose or whether adjustments need to be made.

Overall, a mission statement is a valuable tool for guiding the database design process and ensuring that the resulting database is aligned with the goals and purpose of the organization.

What development in operating systems happened between the years 1990 and 2000?

Answers

Answer:

The Linux operating system was released.

Explanation:

:)

Answer: the linux operating system was released

Explanation: got 100

List and explain the factors to consider when buying a computer


Answers

Answer:

what it's main use is going to be

Explanation:

The main factor when considering buying a PC is what it's main use is going to be. This will determine what components you will need to look for. For example, if you are going to use the computer for video editing and work then you will need one with a high end CPU and lots of RAM. If you are going to use the PC for regular everyday use such as work programs (AutoCAD, Office, Photoshop, etc. ) Then you can buy a regular office computer with a mid-tier CPU, and 8GB of RAM, and no graphic card. A PC for gaming at high resolutions will require all high end parts including a high end graphics card. Therefore, knowing what its main use will be will determine cost, and what tier components you will need to buy.

which wireless technology connects with most mobile devices?

Answers

Answer:

¡) Internet

¡¡) Alexa

¡¡¡) Electronic Devices

The wireless technology that connects with most mobile devices is

Wi-Fi.

We have,

Wi-Fi is widely available and compatible with a vast range of smartphones, tablets, laptops, and other mobile devices, making it a popular choice for wireless connectivity.

Wi-Fi has become ubiquitous and widespread due to its convenience, flexibility, and high data transfer rates.

Most modern mobile devices come equipped with Wi-Fi capabilities, enabling users to connect to Wi-Fi networks and access the internet without the need for physical cables. It allows for seamless and reliable internet connectivity, enabling users to access online services, browse the web, stream media, send emails, and use various applications on their mobile devices while on the go or within the coverage area of a Wi-Fi network.

Thus,

The wireless technology that connects with most mobile devices is

Wi-Fi.

Learn mroe about wireless technologies here:

https://brainly.com/question/32338552

#SPJ3

xamine the following output:

Reply from 64.78.193.84: bytes=32 time=86ms TTL=115
Reply from 64.78.193.84: bytes=32 time=43ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=47ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=73ms TTL=115
Reply from 64.78.193.84: bytes=32 time=46ms TTL=115

Which of the following utilities produced this output?

Answers

The output provided appears to be from the "ping" utility.

How is this so?

Ping is a network diagnostic   tool used to test the connectivity between two network devices,typically using the Internet Control Message Protocol (ICMP).

In this case, the output shows   the successful replies received from the IP address 64.78.193.84,along with the response time and time-to-live (TTL) value.

Ping is commonly used to troubleshoot   network connectivity issues and measureround-trip times to a specific destination.

Learn more about utilities  at:

https://brainly.com/question/30049978

#SPJ1

Can anyone do this I can't under stand

Can anyone do this I can't under stand
Can anyone do this I can't under stand
Can anyone do this I can't under stand
Can anyone do this I can't under stand
Can anyone do this I can't under stand

Answers

Answer:

I think u had to take notes in class

Explanation:

u have yo write 4 strings

You are a knowledge engineer and have been assigned the task of developing a knowledge base for an expert system to advise on mortgage loan applications. What are some sample questions you would ask the loan manager at a bank?​

Answers

As a knowledge engineer, it should be noted that some of the questions that should be asked include:

What do you expect in the loan application process?How is the loan going to be processed?What do you expect from the applicant to fund the loan?

A knowledge engineer simply means an engineer that's engaged in the science of building advanced logic into the computer systems.

Since the knowledge engineer has been assigned the task of developing a knowledge base for an expert system to advise on mortgage loan applications, he should asks questions that will be vital for the loan process.

Learn more about engineers on:

https://brainly.com/question/4231170

Other Questions
From talk radio to television show, from popular magazines to web blogs, ordinary citizens, political figures, and entertainers express their opinions on a wide variety of topics. Are these opinions worthwhile? Does the expression of such opinions foster democratic values? (two questions) Find the mean for the following frequency tables. (Round your answers to one decimal place.)(a) Grade Frequency49.559.5 259.569.5 369.579.5 779.589.5 1189.599.5 5(b) Daily Low Temperature Frequency49.559.5 5259.569.5 3069.579.5 1579.589.5 189.599.5 0(c) Points per Game Frequency49.559.5 1459.569.5 3369.579.5 1579.589.5 2489.599.5 2 This artist was the first to break with the artistic tradition of the Middle Ages and one of the first to use the fresco technique in painting. The people in his paintings were realistic and their faces showed emotions.Who is this artist? A) Giotto di BondoneB) Leonardo da VinciC) Masaccio Please Help I am Confused How is this answered? According to the Thirteenth Amendment, who could be forced to workwithout pay? The idea that men are judged in our culture according to what they can do, but women are judged according to their appearance and beauty is referred to as the give your opinion of whether you favor or oppose the following statement first, and next explain the reasons by using the knowledge you have earned from your major courses. "Sustainability is the utmost on-going concern for business organizations. So demanding social responsibility from companies is disruptive and unhelpful to the corporate growth and development." The forces in (Figure 1) are acting on a 1.0 kg object.What is ax , the x -component of the object's acceleration while heart rate increases and decreases depending upon activity level, on average a typical persons heart rate is about___ beats per minute find the mode of 8,6,7,9,7,0,2,3,5,7,8,9,6,9 Suppose that every consumer is born with zero financial wealth and lives through three periods: youth, middle age, and retirement age. Consumers work in the first two periods and retire in the last one. Their income is $5 in the first period, $25 in the second, and $0 in the last one. Inflation and expected inflation are zero, and the real interest rate is also zero.a) What is the present discounted value of future labour income at the beginning of life? What is the highest sustainable level of consumption such that consumption is equal in all three periods? [1]b) For each age group, what is the amount of saving that allows consumers to maintain the constant level of consumption you found in (a)? (Hint: Saving can be a negative number, if the consumer needs to borrow in order to maintain a certain level of consumption.) [2]c) Suppose there are N people born each period. What is the total saving? (Hint: Compute the total amount saved by the generations that save and subtract the total amount dissaved by the generations that dissave.) [1]d) What is the total financial wealth in the economy? (Hint: Compute the financial wealth of people at the beginning of the first period of life, the second period of life, and the third period of life. Remember that people can be in debt, so financial wealth can be negative. Add them up.) Simplify each expression (prerequisiteskill)A. 3x - 5 - xB. 4x - 5y + x + 7yC. 6-7y - 1 - 10yD. 4(3x - y) - 2(5x + 6y)E. 5x (3x 9y) + yF. 2(4x - 6 - 7 - 8) + 3(x - 2y)(9x 6y) (9x 6y) What changed the lives of the men and women in the book of Acts? Use complete sentences. Charged ions are traveling through a cell membrane with the concentration gradient. Which process is represented here?. Which of these tables represents a linear function?Plz Hurry What does loaded question mean? Rewrite the expression as a single exponent Which of the following is a primary air pollutant produced from burning coal? What contribution did andreas vesalius and william harvey make in the fields of human anatomy and physiology?