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
How can you tell which of the policies in the security options folder have changed settings?
Aliun [14]
By what kind of computer it is but if you need the sedings fixed  go to best buy and they will fix the computer
6 0
3 years ago
Add this in binary numbers . (1100011+11111+111) ​
Brut [27]

see the attachment..........

8 0
2 years ago
Read 2 more answers
Which of the following correctly shows the general structure of a for-each loop header?for (initialization; condition; increment
ladessa [460]

Answer:

for (type variable-name : array-or-collection)-On each iteration the next element can be accessed using the specified variable.

Explanation:

the general structure of a for-each loop header is represented as :

for (type variable-name : array-or-collection) - On each iteration the next element can be accessed using the specified variable.

In other words it can be represented as:

for (type variable-name : array-or-collection)

{  

   //On each iteration the variable-name will contain the next value in the array or collection and this value can be referenced in the loop body using the variable-name.

}

6 0
4 years ago
While performing maintenance work on the components of a computer, you feel a small electric shock. Before you began working, yo
Colt1911 [192]
Static electricity could have build up because of your clothes
6 0
4 years ago
television broadcasts were originally delivered by using which technology? ethernet wireless coaxial cable broadband
laiz [17]

Television broadcasts were originally delivered by using:

  • Ethernet
  • Coaxial cable
  • [Wireless] or  Broadband

<h3>What is Ethernet is used for?</h3>

Ethernet is known to be a kind of network or services that is often used to link two or more devices in a network.

This is known to be very  popular kind of network connection. It is known to be used in  local networks by specific organizations such as offices, school campuses and  it is used often for Television broadcasts.

Therefore,  Television broadcasts were originally delivered by using:

  • Ethernet
  • Coaxial cable
  • [Wireless] or  Broadband

Learn more about Ethernet from

brainly.com/question/1637942

#SPJ1

7 0
2 years ago
Other questions:
  • Which features can Danica use to fix the issue
    5·1 answer
  • Using the given definition of the Measurable interface: public interface Measurable { double getMeasure(); } Consider the follow
    10·1 answer
  • Write a program that reads a stream of integers from the console and stores them in an array. The array is then analyzed to comp
    10·1 answer
  • Now suppose that the file is broken into 5 packets, each of 10 Mbits. Ignore headers that may be added to these packets. Also ig
    14·1 answer
  • Function of an actuator
    8·2 answers
  • Determine the distance between point (x1, y1) and point (x2, y2), and assign the result to points Distance. The calculation is:
    12·1 answer
  • Which view allows you to make changes to the content of your presentation?
    13·1 answer
  • In many multiprocessor systems __________ is used rather than dedicated processor assignment; in order to evenly distribute work
    14·1 answer
  • This seems like a good time to ask the basic question, “How’s it going in class?” Feel free to offer constructive feedback about
    6·2 answers
  • Outline the steps for logging into E-mail account​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!