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]
3 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]3 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]3 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
Plato :
ddd [48]

Answer:

filler content

Explanation:

Isabel must use some sort of filler content while creating a wireframe that she is up with. For the banner, she can make use of the placeholder, and for the text, she can make use of the lorem ipsum. Also, if the wireframe is low fidelity then only she can use above. And if the wireframe is high fidelity then she should use the original banner and text.

3 0
3 years ago
Read 2 more answers
Rank these three account types in order of decreasing liquidity. Start by picking the most liquid account type first
Ghella [55]
As there are no options given, I will simply mention the three most liquid accounts in order:

<span>1. Checking Account
2. Savings Account
3. Money Market Deposit Account

Account liquidity refers to the ease and comfort with which you can take your money out of an account from a bank, there are various bank accounts which can be referred to as liquid assets.</span>
5 0
3 years ago
Read 2 more answers
Write at least 4 sentences
elixir [45]

Answer:

I don't know who advance the evolution who is it!

8 0
3 years ago
Where or what website can I download anime's? For free ​
Artemon [7]

<em>https://todo-anime.com/</em>

5 0
2 years ago
What is a form of technology that you think will make your life easier?
zzz [600]

Answer:

Digital communication technologies

Explanation:

connecting people across the globe has become easier and faster. Platforms such as Zoom, Room, Microsoft teams, WebEx, and many others are buzzing virtual world spaces to connect and share.

5 0
2 years ago
Other questions:
  • What is the term for a device that converts digital data from a computer into analog signals and back again?
    9·1 answer
  • Write a method swaparrayends() that swaps the first and last elements of its array parameter. ex: sortarray = {10, 20, 30, 40} b
    15·1 answer
  • Productivity can best be described as:
    5·2 answers
  • Which segment of society introduced the grunge look?
    5·2 answers
  • One of your professors has asked you to write a program to grade her midterm exams, which consist of only 20 multiple-choice que
    15·1 answer
  • Which operating system user interface does not reside on the computer but rather in the cloud on a web server?
    5·1 answer
  • Drag each label to the correct location on the image. Match the movie qualities with the right period of movies.
    8·1 answer
  • Selma writes the following four answers in her Computer Science examination.
    8·2 answers
  • Who was the father of computer?????​
    11·2 answers
  • Really helpful, I want to get together tomorrow ,Later I will follow and make it the best answer
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!