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
BlackZzzverrR [31]
2 years ago
13

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

Computers and Technology
1 answer:
Akimi4 [234]2 years ago
8 0

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.

You might be interested in
Tyra used the software development life cycle to create a new game. After debugging and documenting code, she released it to her
REY [17]

Answer:

Maintenance

Explanation:

Maintenance

This primarily involves updating and making improvements based on user feedback, as well as resolving any defects that arise.

6 0
3 years ago
unlike tv or newspaper ads, internet communications are interactive, and consumers can choose which messages and information the
Softa [21]

Companies often engage the services of Advertising firms to market their products. Company web offerings can be tailor-made for the consumers.

  • Advertising agencies are firms that makes, plan and handle the advertising needs of any business. They are known for handling negotiations creating tailored marketing campaigns.

A lot of agencies do not want to talk about pricing until they know what you can afford to spend.

Tailored content are delivered experiences that speak directly to customers.

This agencies uses their connections and resources to make one's campaign successful and cost-efficient.

Learn more from

brainly.com/question/23477855

5 0
2 years ago
Which is true about SSH and Telnet?
MaRussiya [10]

Answer:

Data is encrypted on SSH

Explanation:

Telnet and SSH both are the networking protocols. These protocol are used for the security of data. In telnet data is sent over the link without any encryption. That is the reason, in telnet protocol data is less secure.

In SSH (Security Shell) protocol data has been encrypted before transmission. The encryption of data make it more secure between transmitter and receiver.

So the true statement is that, SSH has data encryption.

8 0
3 years ago
Como se juega robótica de cokitos
Anton [14]

Answer:

No sé.

Explanation:

Especifica más.

4 0
2 years ago
The internet and the World Wide Web were results of years of research by Pioneers such as Ray Tomlinson, Vincent Cerf, Vannevar
iren [92.7K]

Answer:

The Internet began as a US Department of Defense network named Advanced Research Project Agency Network (ARPANET) funded by the Advanced Research Project Agency (ARPA, later DARPA). In the 1970s, universities and other educational institutions began sharing this technology. The network grew as more and more users began sharing information.However, the information being shared on this network was very limited because of its government ties. The ARPANET was decommissioned in 1990. This move was followed by the commercialization of the Internet, which allowed it to carry business and personal traffic.

Explanation:

8 0
3 years ago
Other questions:
  • Ryan wants to ensure that all the words in this document are evenly spaced so that they look neat and readable . Which option in
    12·1 answer
  • Which best describe a resource each student could use to find information
    6·2 answers
  • If your cousin wanted to view information from the world wide web, what application software would you tell her to be sure she h
    11·1 answer
  • Respond to the following in three to five sentences. Select one netiquette guideline. Explain how this helps you draft more effe
    9·1 answer
  • EXCEL 2016:
    8·2 answers
  • Select the correct answer.
    12·1 answer
  • State the function of the <br> BIOS,​
    11·1 answer
  • If each integer occupies one 64-bit memory cell and is stored using sign/magnitude notation, what are the largest (in terms of a
    12·1 answer
  • 5. Nadia wants to calculate the total interest, which is the total amount of the payments minus the loan amount. In cell F6, ent
    8·1 answer
  • A. Mohit has bought a new laptop. The laptop is not working as no software is installed in
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!