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
nataly862011 [7]
4 years ago
5

he function below takes one parameter: a list of strings (string_list). Complete the function to return a new list containing on

ly the strings from the original list that are less than 20 characters long.
Computers and Technology
2 answers:
Aleks04 [339]4 years ago
4 0

Answer:

def select_short_strings(string_list):

   new_list = []

   

   for s in string_list:

       if len(s) < 20:

           new_list.append(s)

   return new_list

   

lst = ["apple", "I am learning Python and it is fun!", "I love programming, it is easy", "orange"]

print(select_short_strings(lst))

Explanation:

- Create a function called <em>select_short_strings</em> that takes one argument <em>string_list</em>

Inside the function:

- Initialize an empty list to hold the strings that are less than 20

- Inside the loop, check the strings inside <em>string_list</em> has a length that is smaller than 20. If found one, put it to the <em>new_list</em>.

- When the loop is done, return the <em>new_list</em>

- Create a list to check and call the function

3241004551 [841]4 years ago
3 0

Answer:

# the solution function is defined

# it takes a list as parameter

def solution(string_list):

# an empty new list is initialized

new_list = []

# a loop that loop through the splitted_list

# it checks if the length of each string is less than 20

# if it is less than 20

# it is attached to the new list

for each_string in string_list:

if(len(each_string) < 20):

new_list.append(each_string)

# the new list is printed

print(new_list)

# the function is called with a sample list

solution(["The", "player", "determined", "never", "compromised"])

Explanation:

The program is written in Python and it is well commented.

You might be interested in
Nadia has inserted an image into a Word document and now would like to resize the image to fit the document better. What is the
Mnenie [13.5K]

Answer:

use of keyboard shortcut sizing handles

7 0
3 years ago
Which of the following sentences is most appropriate for written communication at work or with a customer?
Ymorist [56]

there is nothing to choose from

5 0
3 years ago
Read 2 more answers
What technology was implemented on apple computer printer ports to facilitate file and printer sharing?
Shtirlitz [24]

A technology which was implemented on Apple computer printer ports to facilitate file and printer sharing is LocalTalk.

<h3>What is a printer?</h3>

A printer can be defined as an electronic output (peripheral) device that is designed and developed for printing paper documents containing texts or images on a computer system.

On Apple computer printer ports, a technology which was implemented to facilitate file and printer sharing is LocalTalk, which is typically implemented based on the physical layer of the AppleTalk networking system.

In this context, we can infer and logically deduce that a technology which was implemented on Apple computer printer ports to facilitate file and printer sharing is LocalTalk.

Read more on printer here: brainly.com/question/17100575

#SPJ1

4 0
2 years ago
For this exercise, you are going to write your code in the FormFill class instead of the main method. The code is the same as if
LiRa [457]

Answer:

  • Explanation:How many grams are in 5.4 moles of iron (III) sulfate, Fe2(SO4)3?<u>⇔⇔∉↑·</u><em><u>ПНПёП</u></em><u>сж</u>

ЫЫЫЁ

Explanation:

  • Explanation:How many grams are in 5.4 moles of iron (III) sulfate, Fe2(SO4)3?<u>⇔⇔∉↑·</u><em><u>ПНПёП</u></em><u>сж</u>

ЫЫЫЁ

7 0
3 years ago
Please helpppp me!! thank youuu :)
Usimov [2.4K]

Answer:

3?

Explanation:

3 0
3 years ago
Other questions:
  • What engine component is shown in the above Figure?
    14·2 answers
  • The entirety of a packet at one layer becoming the payload section at another layer is known as
    8·2 answers
  • How do i convert videos on the computer
    10·1 answer
  • Which type of memory helps in reading as well as writing data? With the help of , a computer can read as well as write or modify
    11·3 answers
  • Write a python function average_sample_median(n,P), that return the average of 1000 samples of size n sampled from the distribut
    10·1 answer
  • A_____ handles all the instructions that it received from hardware and software which are available on the computer ​
    10·1 answer
  • Nobody mind this plz
    14·1 answer
  • Write a summary on the video "Greatest Inventions w/Bill Nye".
    10·1 answer
  • 2. Name the substance you think is in the cylinder that you cannot see and prevents the plunger from going all the way in even w
    12·1 answer
  • According to the selection, speech-software developers are still striving to develop speech-recognition technology that —
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!