write a python function that takes the largest and smallest numbers in a list, and swap them (without using min() or max() )

Answers

Answer 1

Answer:

def SwapMinMax ( myList ):

   myList.sort()

   myList[0], myList[len(myList)-1] = myList[len(myList)-1], myList[0]

   return myList

   

Explanation:

By sorting the list, you ensure the smallest element will be in the initial position in the list and the largest element will be in the final position of the list.

Using the len method on the list, we can get the length of the list, and we need to subtract 1 to get the maximum element index of the list.  Then we simply swap index 0 and the maximum index of the list.

Finally, we return the new sorted list that has swapped the positions of the lowest and highest element values.

Cheers.


Related Questions

what is the purpose of social networking sites

Answers

Explanation:

social networking sites allow users to share ideas, digital photos and videos, posts, and to inform others about online or real world activities and events with people in their network.

Amanda a recently moved into a new home. Everyone has their own tablet, and wants to connect to the same network, no matter where they are in the house. Which type of network is best for Amanda and her family?nd her family recently moved into a new home. Everyone has their own tablet, and wants to connect to the same network, no matter where they are in the house. Which type of network is best for Amanda and her family?

Answers

Answer:

wifi is the best network for all, As it gets in all corners of the house.

When you're formatting in excel 2013 there are basically three levels of formatting, put the
three levels in order of top to bottom levels​

Answers

Answer:

The answer is "themes, styles, and direct formatting".

Explanation:

The selection of regular colors, font color, or type effects is also known as the Themes. There are many built-on Excel categories accessible mostly on page layout menu: an overview of its impact on the workbook could be accessed via a topic. You may find which various fonts will affect the design of your workbook.  The style of a column is indeed a defined collection of layout tools like font and font color, numbers, cell borders, and cell shading. The range of cell styles incorporated, that can be added or modified. It could also alter or double a cell template to build your customizable cell model. To use a customized format it includes the font, color, borders, etc. It is the direct formatting for the document at a certain time and anywhere. It selects the cell and starts changing the font from the font drop list to modify the font of its current document.

Which of the following is usually used to connect a monitor to a computer?
O DVI cable
O USB cable
O Ethernet cable
O SATA cable

Answers

Answer:

Ethernet cable

Explanation:

this is because you usually use a ethernet cable at schools , offices and even at home so ya tell me if im wrong

The DVI cable is usually used to connect a monitor to a computer option (A) DVI cable is correct.

What is a computer?

A computer is a digital electronic appliance that may be programmed to automatically perform a series of logical or mathematical operations. Programs are generic sequences of operations that can be carried out by modern computers.

The Digital Display Working Group created the digital video interface known as DVI (Digital Visual Interface) (DDWG).

It is frequently found on computers, LCD monitors, projectors, and other digital display devices.

It supports both digital and analog video signals via a single DVI connection.

Thus, the DVI cable is usually used to connect a monitor to a computer option (A) DVI cable is correct.

Learn more about computers here:

brainly.com/question/21080395

#SPJ2

Compare WiFi hotspot and cyber cafe ??? I will give you slot of points HELP!!!

Answers

Explanation:

A WiFi hotspot is a wireless internet connection that allows a computer, smartphone, or other internet-enabled devices to connect to internet access points.

While a Cybercafe (internet cafe) refers to any business space which allows people to access the internet usually within its premises after paying for connection access. Unlike Wifi hotspot, a cybercafe in most cases provides computers to their customers.

Answer:

ExplanatiA WiFi hotspot is a wireless internet connection that allows a computer, smartphone, or other internet-enabled devices to connect to internet access points.

While a Cybercafe (internet cafe) refers to any business space which allows people to access the internet usually within its premises after paying for connection access. Unlike Wifi hotspot, a cybercafe in most cases provides computers to their customers.on:

Screenwriters would be least involved in planning which type of film?

Answers

This question is incomplete; here is the complete question:

Screenwriters would be least involved in planning which type of film?

A. Mystery

B. Historical fiction

C. Documentary

D. Adventure

The answer to this question is C. Documentary

Explanation:

The role of screenwriters is to create different elements in a film including the dialogues between the characters, the actions or events that occur, and even the general story that is told. Due to this, screenwriters play an essential role in fiction based films which include genres such as historical fiction, adventure, science fiction, etc.

However, screenwriters are less involved in genres such as documentaries because the purpose of documentaries is to show reality, this implies there are no fictional characters or one fictional story playwriters should create.

Answer:

b: documentary

Explanation:

edg2021

what connects data center to your device?

Answers

My answer to the question is ISP(Internet Service Provider).

#TODO: Define a data structure to keep track of which links are part of / not part of the spanning tree.

Answers

Answer:

A spanning tree is a subset of Graph G, which has all the vertices covered with minimum possible number of edges. Hence, a spanning tree does not have cycles and it cannot be disconnected.. By this definition, we can draw a conclusion that every connected and undirected Graph G has at least one spanning tree.

You are configuring two PCs for your network, PC-A is given an IP address of 192.168.1.18 and PC-B is given an IP address of 192.168.1.33. Both PCs receivces a subnet mask of 255.255.255.240A) what is network address of PC-A?B) what is network address of PC-B?C) will these PCs be able to communicate directly wiyh each other?D) what is the highest address that can be given to PC-B that allows it to be on the same network as PC-A ?

Answers

Answer:

Explanation:

a) 192.168.1.16

b) 192.168.1.32

c) No

d) 192.168.1.30

Answer:

It’s somethint

Explanation:

Which of the following situations would notqualify for the fair use exception to United States copyright law?A) Google posts thumbnail images of books in the Google Book Search Project.B) A student copies a photograph of his favorite band from a Web site created by the band's record label andplaces it on the student's personal Web site. C) A professor clips a newspaper article just before class and distributes copies of it to his class.D) A journalist quotes a paragraph from a book in a review of the book.

Answers

Answer:

C. A student copies a photograph of his favorite band from a Web site created by the band's record label and places it on the student's personal Web site.

Explanation:

Because this is deemed an offence as the student never got a formal copyingpermit

Mateo has received a Word document from a customer that contains private information and is secured with a password. However, when Mateo tries to open the
document in his browser, he gets an error message. How might he fix this problem?
a Use a secure website that starts with HTTPS
b. Open the document in the Word app installed on his computer
c Save the document in the cloud
d Ensure there's a lock icon in the browser

Answers

Answer:

open it in a different app

Explanation:

______was developed as an interim management protocol with OSI as the ultimate network management protocol.

Answers

Answer:

Simple Network Management Protocol

Explanation:

Simple Network Management Protocol otherwise referred to as SNMP is a form of computer protocol that is mainly used in obtaining and regulating information relating to connected gadgets. It is practically based on the internet and was originally planned as an interim protocol.

Hence, it can be concluded that the Simple Network Management Protocol was developed as an interim management protocol with OSI as the ultimate network management protocol.

In real-world environments, once the domains that are affected by the risks are identified, subsequent next steps would include:______.

Answers

Answer:

Explanation:

In real-world environments, once the domains that are affected by the risks are identified, subsequent next steps would include selecting, implementing, and testing controls to minimize or eliminate those risks.

Expain the application areas of ICT in education sector and E-commerce​

Answers

Explanation:

Nowadays almost all the school and college use computers in classrooms and labs to teach students.A teacher can teach effectively using computer-based presentations.Students can study different subjects and complete their assignment by using different software in computer.The Computer Based Training(CBT) and Web Based Training(WBT) are aid to teach the student in the classroom.

E-commerce is a financial business transaction conducted electronically between business partners over the internet.Business transactions can occur very quickly and globally.The people can buy,sell and exchange the products or services using internet.Todays many computer can also access the Internet through wireless technologies.

SQL a. has become the de facto standard database language b. can be used to define database systems c. both a. and b. d. none of the above

Answers

Answer:

a.)has become the de facto standard database language

Explanation:

SQL known as Structure Query Language can be described as domain specific language that is Been used in execution of tasks son database. Those task could be updating of data.

Database admistraion.

Microsoft SQL server is one of the example of database system that uses SQL.

It should be noted that SQL has become the de facto standard database language

What are three purposes of the Media Creation Tool application?

Answers

Answer:

The first purpose fo the Media Creation Tool Application is:

to enable the creation or building the Windows 10 installation media. The Windows 10 installation media is not Windows 10It can also be used to repair an existing installationIt is used to make a bootable USB memory stick for use in the installation of Windows 10

Cheers!

The three purposes of the Media Creation Tool application are:

To stored data.To download a Windows 10 install file.To reinstall Windows 10.

What is the purpose of the media creation tool?

The Media Creation Tool is known to be an application that helps a person to be able to download a Windows 10 install file.

Here the person can get this file and put it into a flash drive or a DVD and then one can save it  so that one can be able to still use it to reinstall the Windows 10. It is known to act as a kind of backup option in case your system has malfunctions.

Learn more about Media Creation from

https://brainly.com/question/1114645

Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total.For example, if the user enters 10 for subtotal and 15% for gratuity rate,the program displays $1.5 as gratuity and $11.5 as total.Sample RunEnter the subtotal and a gratuity rate: 10 15The gratuity is $1.5 and total is $11.5Class Name: Exercise02_05

Answers

Answer:

Using Javascript,

function calTotal( subtotal, gratuity){

  gratuityValue = subtotal * (gratuity/100)

  total = subtotal + gratuityValue

  console.log( "gratuity: ", gratuityValue , "\nTotal: ", total)

}

Explanation:

The javascript function above is able to collect two parameters subtotal and gratuity rate in percentage and calculate the total and gratuity value, and displays it on the console.

Anna wants to keep information secure from offenders. Which software should she install on her computer to ensure Internet safety?
O A database software
OB
presentation software
OC. anti-virus software
OD
graphics software

Answers

Anna wants to keep information secure from offenders. Which software should she install on her computer to ensure Internet safety?

O A database software

OB

presentation software

OC. anti-virus software

OD

graphics software

Answer: OC

4 types of system software

Answers

Operating systems.
Device drivers.
Middleware.
Utility software.

4 types of system software: Operating Systems (OS), Device Drivers, Utilities, and Language Translators.

1. Operating Systems (OS): Operating systems are the core system software that manages computer hardware and software resources.

They provide an interface for users to interact with the computer and facilitate the execution of applications.

2. Device Drivers: Device drivers are software components that enable communication between the operating system and hardware devices like printers, graphics cards, and network adapters.

3. Utilities: System utilities perform various maintenance tasks, such as disk defragmentation, file management, backup, and system optimization.

4. Language Translators: These tools, including compilers and interpreters, translate high-level programming languages into machine code that the computer can execute.

Know more about system software:

https://brainly.com/question/30166062

#SPJ5

Students enrolled in a digital classroom participate in discussions and take field trips with classmates. watch instructional videos and turn in assignments online. take notes online but take tests in front of a teacher at school. listen to lectures online but make presentations at school.

Answers

Answer:b

Explanation:gszrxewzgdtxherhzre

Students enrolled in a digital classroom participate in discussions and take field trips with classmates turn in assignments online.

What is assignment?

Assignment is defined as a duty that you have been tasked with by a higher authority. The verb "to assign" is used to assign duties or jobs to other people, while the word "assignment" is essentially the verb's noun form. The opportunity to learn, practice, and demonstrate mastery of the learning objectives is provided to the students. It gives the teacher proof that the students have met their objectives.

Keep an eye on how the students are using the technology. Examine how students are collaborating and what websites or apps they are using by moving around the classroom. Give pupils detailed instructions on the school's policies and practices for using technology in the classroom.

Thus, students enrolled in a digital classroom participate in discussions and take field trips with classmates turn in assignments online.

To learn more about assignment, refer to the link below:

https://brainly.com/question/29585963

#SPJ2

A(n) _____ is a common output device for hard copy.
a. laser printer
b. optical character reader
c. plasma display
d. compact disc

Answers

The answer is d it is d it is d I think I think, I’m not sure though

Which guidelines should be used to make formatting tasks more efficient?

Answers

Answer:

Use pasted text only; this does not keep the original formatting.

Explanation:

Where do today's computers store almost all motherboard configuration data?A) BIOS ROMB) CMOS RAMC) DIMM RAMD) Solid State Disk

Answers

Answer:

In the CMOS RAM

Explanation:

It's the only answer that is available. New computer's store the data in TPM (Trusted Platform Module) is an international standard for a secure cryptoprocessor, a dedicated microcontroller designed to secure hardware through integrated cryptographic keys.

Today's computers store almost all motherboard configuration data in CMOS RAM (Complementary Metal-Oxide-Semiconductor Random Access Memory). (Option B)

How  is this so?

CMOS RAM is a type of non-volatile memory that retains data even when the computer is powered off. It is typically powered by a small battery on the motherboard.

The configuration data stored in CMOS RAM includes settings such as system date and time, boot order, hardware settings, and other BIOS (Basic Input/Output System) configurations.

Thus the correct answer is Option B - Complementary Metal-Oxide-Semiconductor Random Access Memory

Learn more about motherboard  at:

https://brainly.com/question/12795887

#SPJ6

2.2-2 Consider sorting numbers stored in array by first finding the smallest element n A of and exchanging it with the element in . Then find the second smallest A AOE1 element of A, and exchange it with . Continue in this manner for the firs AOE2 1 elements of A. Write pseudocode for this algorithm, which is known as selection sort. What loop invariant does this algorithm maintain? Why does it need to run for only the firs elements, rather than for all elements? Give the best-case n 1 n and worst-case running times of selection sort in ‚-notation.

Answers

Answer:

Follows are the explanation of the choices:

Explanation:

Following are the Pseudocode for selection sort:                      

for j = 0 to k-1 do:

      SS = i

      For l = i + 1 to k-1 do:

        If X(l) < X(SS)

          SS= l

        End-If

      End-For

      T = X(j)

      X(j) = X(SS)

      X(SS) = T

    End-For

Following are the description of Loop invariants:

The subarray  A[1..j−1] includes the lowest of the j−1 components, ordered into a non-decreasing order, only at beginning of the iteration of its outer for loop.  

A[min] is the least amount in subarray A[j.. l−1] only at beginning of the each loop-inner iterations.                      

Following are the explanation for third question:

Throughout the final step, two elements were left to evaluate their algorithm. Its smaller in A[k-1] would be placed as well as the larger in A[k]. One last is the large and medium component of its sequence because most and the last two components an outer loop invariant has been filtered by the previous version. When we do this n times, its end is a repetitive, one element-sorting phase.

Following is the description of choosing best-case and worst-case in run- time:

The body the if has never been activated whenever the best case time is the list is resolved. This number of transactions are especially in comparison also as a procedure, that will be (n-1)(((n+2)/2)+4).    

A structure iterator at every point in the worst case that array is reversed, that doubles its sequence of iterations in the inner loop, that is:(n−1)(n+6) Since both of them take timeΘ(n2).

In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After statement cin >> one >> two; executes________ a) one = 10.5, two = 10.5 b) one = 11, two = 31 c) one = 30.6, two = 30.6 d) one = 10.5, two = 30.6

Answers

Answer:

The answer is "Option d"

Explanation:

In the given C++ program code, It is defined, that two double type variable "one and two" is defined, that holds the two double value that is "10.5 and 30.6".

In this code, it uses the "cin" method for input values from the user ends, when we execute this code, it provides the console screen, that inputs the double type value from the user side, and other given choices were wrong because it holds different values.

What is the full form of computer ​

Answers

Answer:

Computer is not an acronym, it is a word derived from a word "compute" which means to calculate. Some people say that COMPUTER stands for Common Operating Machine Purposely Used for Technological and Educational Research.

Check
Which tasks can a user accomplish by using the Find and Replace feature of Word? Check all that apply.
changing the size of the page
changing the case of a word
changing the spelling of a word
changing the margins of the page
changing a word to another word

Answers

Answer:

B,C,E :)

Explanation:

Answer:

B, C, E is the correct answer

Explanation:

edge2021

Changing the appearance of the text in your document, is to _________________ it.

Answers

Answer:

Format

Explanation:

I dont really know what the explanation would be but hope this helps.

Which of the following is considered a basic task in the context of computer operations? a. Connecting to the Internet b. Natural language processing c. Word processing d. Logical operations

Answers

Answer:

The answer is "Option d".

Explanation:

The performing function into the computer is made up of three basic functions, that are: logical, arithmetical, and memory processes, in which the logical process or function is a particular symbol or expression, that links two or more knowledge sentences, and the incorrect choices can be explained  as follows:

In Option a, It is wrong because it can't provide the basic tasks.In Option b, It an algorithm, that's why it is incorrect.In Option c, It is a software, which is used to provide editing on text, that's why it is incorrect.

A task which is considered as a basic task in the context of computer operations is: D. Logical operations.

What is a computer?

A computer can be defined as an electronic device that is designed and developed to receive data in its raw form as an input and processes these data into an output (information) that could be used by an end user.

In Computer technology, the basic task in the context of computer operations are broadly classified into three (3) categories and these include the following:

Arithmetical operations.Memory processes.Logical operations.

Read more on computer here: brainly.com/question/959479

How Oracle 12c advances the security discussion?

Answers

Answer: The oracle 12 c advances are given below.

Explanation:

The oracle 12 c provides the ability to tag the data with the label of data. It provides the classification to the data. This allows to check which data is sensitive and also allows the combination of sensitive data to be combined with the same table as the bigger data without compromising the security of the database.

Other Questions
what arecthe challenges of federalism in nepal.give its points. is Human Bone a Plant / Animal / Neither Compute the scale factor of the new scale drawing (SD2) to the first scale drawing (SD1) using the information from the given scale drawings. 2 buckets an 800 balls how many ball will fit in each bucket The moon is 250,000 miles away. How many inches is it away from earth? Dan participates in a study that measures the pleasure he feels after eating a slice from a variety of fruit pies. The independent variable in this study would be Add and subtract fraction Given segment CE and point D that lies on CE, find CD if CE = 15, CD = 30 + 3x, and ED = 25 + 2x (x) = 5x - 9 find each value Identify the mistake in this sentence.We brought a day's supply of granola water andsandwiches.-apostrophe-commas-fragment-run-on Nina's grades could be better. She gets about five hours of sleep every weeknight and ten hours per night on weekends. How much sleep should she get to better concentrate on schoolwork? Five to six hours every night nine to ten hours every night a total of forty hours a week a minimum of eighty hours a week Which best describes the author's purpose in "A Drop in the Bucket"? what are the steps to finding a midpoint with decimals? How would an engineer know if a product design were feasible?The design has never been developed before.O The design fits into the engineer's original vision.O The design has already been proven to keep the cost of the project down.O The design meets all of the criteria and limitations designated by the project. Write in standard notation 6.078 x 10 expo 3 Which three actions does a good writer take? The writer submits the paper a day or two after the deadline. The writer accepts and implements constructive feedback about the paper. The writer starts the research a day before the paper is due. The writer practices writing several drafts of the paper. The writer leaves revising the paper to the teacher or a peer. The writer makes sure there are no grammatical errors in the paper. In an informational text, information that is clearly stated is known as______ information. impliedinferredfactexplicit A property insurance policy is issued at a total cost of $2,540 for 6 months. If the insurance company offers a one-time $50 rebate, what is the cost per month? When a country has a large population, but very little arable land, what challenges might it experience? evaluatethe expression (-0.3)^4. what is the value of the expression