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
erastova [34]
3 years ago
6

Define and implement a method that takes a string array as a parameter and returns the length of the shortest and the longest st

rings in the array
Computers and Technology
1 answer:
Drupady [299]3 years ago
7 0

Answer:

#HERE IS CODE IN PYTHON

#function to find length of shortest and longest string in the array

def fun(list2):

   #find length of shortest string

   mn=len(min(list2))

   #find length of longest string

   mx=len(max(list2))

   #return both the value

   return mn,mx

#array of strings

list2 = ['Ford', 'Volvo', 'BMW', 'MARUTI','TATA']

# call the function

mn,mx=fun(list2)

#print the result

print("shortest length is:",mn)

print("longest length is:",mx)

Explanation:

Create an array of strings.Call the function fun() with array as parameter. Here min() function will find the minimum string among all the strings of array and then len() function will find its length and assign to "mn". Similarly max() will find the largest string and then len() will find its length and assign to "mx". Function fun() will return "mn" & "mx".Then print the length of shortest and longest string.

Output:

shortest length is: 3

longest length is: 5

You might be interested in
The term that refers to the standard computer language for creating web pages is called:
Pavel [41]

Answer:

Language programming Web's programming language

Explanation:

6 0
3 years ago
Money money money money
elena-s [515]

Answer:

i love money <3

Explanation:

8 0
3 years ago
Read 2 more answers
Determine the factors using computer failures and defects​
ladessa [460]

Answer:

Voltage spike – This is a momentary change in the supply of electric power. It’s important to remember that the size of the transient can range from just milliseconds to longer periods of time. Even a small power glitch can damage a computer and corrupt data. If the screen goes blank during a thunderstorm, it’s likely that a voltage spike is responsible.

Circuit board fails with no visible indication of damage – This is the typical scenario: A computer goes down. A defective circuit board is suspected of the fault, but an inspection reveals no signs of physical damage. A replacement board is installed and operation resumes.

Failure to load software upgrades – Computer software often comes with various bugs, or vulnerabilities. These are simply programming mistakes, but they can make the software susceptible to viruses and glitches. When an error is discovered, the software designer sends out a “patch” that requires downloading and rebooting. Failing to upgrade the software by running the patch can lead to corruption of data.

Failure to keep virus protection up to date – There are several malware protection packages available for computer rooms or data centers. Once installed, the subscription must be maintained. One telltale sign of a malware infected computer is slow data processing.

Inadequate cooling – Computers produce heat, and the more data they process, the more heat must be eliminated. Servers, the “brains” of computers, fail under excess heat, so adequate cooling is essential.

Environment – If a computer room has a dedicated cooling system, there may be an opportunity to closely control the heat. If the cooling is shared with other equipment or the space contains offices, we often face a more challenging task. People have comfort needs different to those of computers.

Loss of Power, PDU fails – Power Distribution Units (PDU’s) are similar to power bars in homes and offices. They distribute power to different components in a computer room, and are usually located next to the server racks. PDU’s suffer a range of problems. Receptacles wear out and can be the sources of bad contacts, and moisture can lead to corrosion.

UPS batteries – Uninterruptible Power Supply (UPS) batteries are found in computer rooms. Most often, they are used to provide continuous power for a limited time, during an outage. Depending on how it’s used and the design of the battery, the life span can be as short as 4-5 years for what is considered a “10 year life” battery. Elevated room temperatures will shorten the life of any battery. Even a small facility such as a dentist office uses UPS batteries.

Transfer switch battery defective – This can be an indication that the site lacks an effective battery maintenance program. It can also be a sign that the transfer switch is “frozen” in position. Preventive maintenance could help avoid a breakdown.

Failure of standby power to synchronize (come on line) – When electric power from the grid disappears, standby power takes over in two different ways. In a small computer room, the focus is on turning computers off in a controlled manner. A fully charged UPS will provide power for 10-15 minutes to allow a computer to save its data and turn off. In a larger facility, it’s the matter of keeping cooling and power going long enough to give the standby generator an opportunity to “synchronize,” to get up to a rate of speed sufficient to power the infrastructure and continue data processing.

Diesel fuel contaminated – Most medium to large facilities have generators powered by diesel fuel, which can become contaminated and useless when a power outage occurs. Water is usually the culprit. Regular fuel testing is necessary to avoid contamination.

Storage defective – Data is stored on magnetic disks or tape. Both can be damaged during normal operation, so it’s a good practice to back up stored data on a regular basis. Backing up means creating a spare data storage. Failure of a tape or disk drive is often, but not always, proceeded by noise. Opening the unit to attempt data restoration is better left to a professional.

Sprinkler system turns on above the servers – Where a data room is protected by a water sprinkler system, a small spill can damage the electronic components. This is particularly true in cases where sprinkler heads are located directly above the servers.

Computers are crucial to business today, but there are so many things that can cause them to fail. By addressing the above common culprits, you could help reduce the overall risk of your computer systems failing.

Explantion: I hope this helps!!!!! :)

4 0
2 years ago
Are the blank space around the edges of the page
Law Incorporation [45]

Answer:

The blank space around the edges of a sheet of paper — as with the page of a book — that surrounds the text is called the margin.

8 0
2 years ago
Organisms that reproduce sexually​
weqwewe [10]

Sex glad is responsible

3 0
3 years ago
Other questions:
  • Hi <br> What exactly does this project want from me?thanks for riding
    5·1 answer
  • Any malware software that covertly gathers user information without the user s knowledge, is known as ______ .
    12·1 answer
  • A ____ client locates all or most of the processing logic on the server.
    11·1 answer
  • How are engineers are related to technology
    13·1 answer
  • The color pattern in which marine organisms are light on the bottom and dark on the top of their bodies camouflaging them agains
    11·1 answer
  • What are the cues that a website is safe to use for exchanging sensitive information?
    10·1 answer
  • Imagine that you have a friend who has expressed interest in designing and programming video games. He loves to play video games
    10·1 answer
  • Which of the following is the answer?
    5·1 answer
  • HELP PLZZ FAST!!!!!
    10·2 answers
  • Discuss two basic types of monitors CRT and LCD give me in short ​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!