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 capital letter Wis expressed as U+0057 in which system?
Paul [167]

The capital letter W is expressed as U+0057 in Unicode system

  • The Unicode system is known as a type of coding system which contains worldwide character encoding standard that gives a code to every character and symbol in every language spoken in the world today.

  • It is known as the encoding standard that is used in all languages, It makes sure that an individual can retrieve or combine data with the use of different languages altogether.

Conclusively, we can say that the The capital letter W is expressed as U+0057 in Unicode system

Learn more from:

brainly.com/question/24736173

6 0
2 years ago
Read 2 more answers
Many of today’s digital devices operate on battery power supplied by what kind of ion batteries.
stich3 [128]
"Lithium ion" is used in your cellphone.
6 0
3 years ago
Design (draw a datapath) for a block that will help your processor decide whether to take a branch for different conditions. As
LekaFEV [45]

Answer:

See explaination

Explanation:

Here are the steps taken to draw the diagram!

opcode0 and the opcode1 signals are inverted/not to determine the case whether it is 00, 01, 10, 11.

Then they are 'and'ed with the corresponding Zero/lt signal to confirm if the case is true, for eg. zero = 1 if opcode = 00 (beq).

Then all the cases are 'or'ed to get the Branch signal!

See attachment for the diagram

8 0
3 years ago
Which team behavioral characteristic helps team members to freely express ideas and foster approachability?
vlada-n [284]

Communication is the right answer.

6 0
3 years ago
What do you think are the IPO components in an online movie ticket booking system?
zalisa [80]

Explanation:

Online Movie Ticket Booking System is a website to provide the customers facility to book tickets for a movie online and to gather information about the movies and theaters. Customer needs to register at the site to book tickets to the movie

Advantages of Online Booking Systems

Your business is open around the clock. ...

You can maximize reservations. ...

You get paid quicker. ...

You're not tied to a phone. ...

You can effortlessly up-sell add-ons. ...

It's easy to manage your calendar. ...

You get valuable insight about your business

4 0
3 years ago
Other questions:
  • What is the central unit of the computer that contains the logic circuitry and carries out the instructions of the computer's pr
    13·1 answer
  • To play game, go inside the Grand Theft Auto V folder and right click and runGTAVLauncher as administrator.If you get any missin
    5·1 answer
  • HELP ASAP????? please
    5·2 answers
  • Graphs and charts are two different elements. True or False
    15·1 answer
  • 1) List at least five smaller behaviors you could break the complex behavior "brushing my teeth" into.
    14·2 answers
  • FIGURE A-2—Use the information in this chart to answer Question 2.
    11·1 answer
  • Describe markings on a road that indicate that it is safe to pass.
    10·1 answer
  • which of the following cells can't be recarged? A. Electrode cell B. wet cell C. primary cell D. storage cell
    13·1 answer
  • How are Earth's plates made?
    14·1 answer
  • Create a list called courses containing the names of your current courses.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!