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
Best practices and trends for technology integration
cluponka [151]

Answer:

Technology use must be aligned to the standards. Technology must be integrated into daily learning,

Explanation:

Technology use must be aligned to the standards. Technology must be integrated into daily learning, not used as an add-on to instruction to match personal learning needs. Students need opportunities to use technology collaboratively. Technology must support project based learning and include real-world simulations.

3 0
2 years ago
11. Describe an algorithm that interchanges the values of the variables x and y, using only assignments. What is the minimum num
Svetlanka [38]

Answer:

Following is the algorithm to interchange the value of two variable x and y.

step 1:Read the two integer x and y.

step 2 :t=x

Step 3: x=y  

step 4: y=t

The minimum number of assignment to do this is 3

Explanation:

After reading two integer x & y, create a variable "t" of integer type.

with the help of variable "t", we can swap the value of variable x and y.

It requires 3 assignment to interchange the value.

6 0
3 years ago
What is one purpose of an essay’s conclusion paragraph?
vova2212 [387]
The purpose of the conclusion paragraph is not only to wrap up the essay, but also to show the strong and central points in the essay alone. Since you are wrapping up the essay, it's your final paragraph and you have to clearly state all of your points and what and why the essay is written (depends on what you are talking about). But, the one purpose of an essay's conclusion is to clearly state the central points of the essay.
3 0
3 years ago
The file extension for an MS Excel spreadsheet is ______.<br><br> avi or xls
anygoal [31]
XLS would be it, avi contains like sounds and stuff
6 0
3 years ago
Read 2 more answers
Which one of the following media is most resistant to EMI?
natali 33 [55]

Answer:

D - Fiber-optic Cables

Explanation:

Electromagnetic interference affects cables made from different metals and can corrupt the data running through them. However, Fiber-optic cables are constructed from glass (non-metallic) and transmit pulses of light as signals to transfer data, this means that the cables are most resistant and not susceptible to EMI.

5 0
2 years ago
Other questions:
  • Suppose two hosts, A and B, are separated by 15,000 kilometers and are connected by a direct link of R = 5 Mbps. Suppose the pro
    11·1 answer
  • A county collects property taxes on the assessed value of property, which is 60 percent of its actual value. For example, if a h
    13·1 answer
  • A group of students want to create an educational online game for computer laboratory in their school which type of network will
    6·1 answer
  • Assume phrase= "Peter Piper picked a peck of pickled peppers", What will be returned if phrase.search(/[aeiou]/) is called?
    9·1 answer
  • This morning when Paul turned on his computer at work, it would not boot. Instead, Paul reported that he heard a loud clicking n
    15·1 answer
  • Which job role requires you to create user guides for computer products and services?
    11·1 answer
  • Que significa WWW en informática ._.​
    11·1 answer
  • Which statement best describes the problem statement below?
    6·1 answer
  • Write an algorithm of telephone call system​
    10·2 answers
  • Write the name of main ore of silver.Write any two application of sliver​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!