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 picture that graphically represents the items you use in Windows is called a/an <br> ___?
jasenka [17]
The picture that graphically represents the items you use in Windows is called an icon. 
8 0
3 years ago
Sami is creating a web page for her dog walking business. Which item will set the theme for her page? Background color Heading c
bazaltina [42]

Answer:

A Background color

Explanation:

7 0
3 years ago
The technology dealing with robots is called
Alisiya [41]
<h2> Robotics </h2>

Robotics is a field of engineering that deal with design and application of robots and the use of computer for their manipulation and processing. ... Robotics requires the application of computer integrated manufacturing, mechanical engineering, electrical engineering, biological mechanics, software engineering.

4 0
3 years ago
What might a programming prefer the top-down approach to programming design?
navik [9.2K]

Top down program design is an approach to program design that starts with the general concept and repeatedly breaks it down into its component parts. In other words, it starts with the abstract and continually subdivides it until it reaches the specific. Consider creating the prime factorization of a number like 1540. The steps involved might look like:

1540

2 x 770

2 x 2 x 385

2 x 2 x 5 x 77

2 x 2 x 5 x 7 x 11

Top down program design works the same way. We start with the overall objective and wind up with a series of steps needed to accomplish it.

3 0
3 years ago
To meet the requirement for the number of vdss on board, what must be true about pyrotechnic vdss?
asambeis [7]

Answer: They must be dated.

Explanation: If pyrotechnic VDSs are used, they must be dated. Expired VDSs may be carried on board, but a minimum of three unexpired VDSs must be carried in the vessel.

5 0
3 years ago
Other questions:
  • After you enter the details for the first selected recipient in the New Address List dialog box, click _______ to add another re
    11·2 answers
  • There are many differenttypes of models, but an individual DSS can consist of onlyone.
    15·1 answer
  • How many bits are required to address a 1mx8 main memory if main memory is byte addressable?
    6·1 answer
  • How can you best protect yourself when using social media
    5·2 answers
  • Laura has identified the job she wants, the skills needed for the position, and the areas she needs to improve in order to get i
    10·1 answer
  • Choose two browsers and compare their security features.
    5·1 answer
  • Three of the most important jobs of security management are to ensure _____ are organized according to sensitivity, ensure that
    10·1 answer
  • 1) Identify at least four examples and uses of application software.​
    5·2 answers
  • AYUDAAA ESPARA HOYYY
    14·2 answers
  • Give an example of what Artificial Intelligence application most popular is used on a daily basis.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!