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
What would be the output of system.out.println("fun\tny");
netineya [11]

Answer:

use google

Explanation:

8 0
3 years ago
What feature of ntfs allows a file or folder to point to another file or folder located somewhere else in the file system?
Tatiana [17]
The click feature>........................................
7 0
3 years ago
There is a huge demand for cyber security professionals. True or false
STatiana [176]
True.
Thank You!
Please mark Brainliest
5 0
3 years ago
Read 2 more answers
Dr. Bloom is writing a test for a history class and wants to ask a question that will have a Boolean value for the answer. Which
Valentin [98]

Answer:

Example

If [variable] = true?

Print(True)

5 0
2 years ago
All margins of a report are _____ inch. *<br><br> 1<br> 2<br> 3<br> 4
MA_775_DIABLO [31]

Answer:

The answer is "1 inch"

Explanation:

The margin is also known as space, it is the distance between the document 's text and edge. In default, its distance is 1, and it also allows you to customize, the new document, which is set to standard.

  • In other words, we can say that it implies the one-inch gap between the text and each edge, which is based on your specifications.
  • It also allows you to customize the margin size of the document, and other choices were wrong because it is the customize size.

6 0
3 years ago
Other questions:
  • The area that holds all the instructions the computer needs to start up when it is powered on is ________.
    11·1 answer
  • ________ is the abbreviation for the place in the computer where the programs and data the computer is currently using are store
    8·1 answer
  • Which of the following is likely the cause of the bass from a sound system rattling the windows on your car?
    11·1 answer
  • What is renewable energy
    13·2 answers
  • 27. List four advantages of Computer Aided Design over traditional hand
    10·1 answer
  • What kind of operating system is MS-DOS?
    8·2 answers
  • Need the answer ASAP!!!
    14·1 answer
  • कम्प्युटर को पहिलो पुस्ता भनेको के हो?​
    8·2 answers
  • A non-profit organization decides to use an accounting software solution designed for non-profits. The solution is hosted on a c
    11·1 answer
  • How do I change my username/display name
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!