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
When sharing a file or folder with someone not in your __________ , you need to input the __________ of the recipient.
Ede4ka [16]
Group, name is the answer
6 0
4 years ago
Read 2 more answers
Write a function named hasFinalLetter that takes two parameters
krek1111 [17]

Answer:

66

Explanation:

gfgrgdgghegdgdggdgdgd

4 0
3 years ago
E-mail administrators may make use of _________________, which overwrites a log file when it reaches a specified size or at the
Karolina [17]
E-mail administrators may make use of Circular Logging which overwrites a log file when it reaches a specified size or at the end of a specified time frame.​Circular logging<span> is a method or feature used to conserve hard disk space by overwriting individual log files, thus keeping the transactional  log to a minimum.</span>
7 0
3 years ago
A news ____ website collects and displays content from a variety of online news sources, including wire services, print media, b
ale4655 [162]

Answer:

Aggregation

Explanation:

This type of website is responsible for collecting the data through RS feeds and web scrapping tools and inject the data in server side templates of highly flexible technologies like pug to display them in one space.By this the user do not will have to walk around many web sites to find the data on news he/she need. This type of news website collects it in one place.

5 0
4 years ago
Name any two basic type of operands<br><br> a. ___________<br><br> b. ___________
liraira [26]

Answer:  A) Constants

                B) Variable

Explanation: The two basic type of operands are-

A) Constants-

constants are the value that do not change once they are defined.

    As for example 5+3, here 5 and 3 are operands and + is an operator.

B) Variable-

It represents a symbolic variable name which helps in storing information in memory.

In A×B, A and B are two operands of variable type whose value can change and it is defined by user or some other dependent operation and × is a operator.  

7 0
3 years ago
Other questions:
  • When powering up the computer, the initial program loading and start-up is performed by using a ______________ program that is b
    14·1 answer
  • What is the process of copying items from ram to a storage device?
    8·1 answer
  • John is an entrepreneur who plans to enter a franchise contract with a hotel business. Which of these is an advantage that John
    15·2 answers
  • What is network topology? PLZZZ HURRY
    9·1 answer
  • Which statement best justifies the use of a high-speed cache in a CPU?
    11·1 answer
  • HP laptop computers are produced on a line, with multiple workers completing one or two specific tasks to assemble the laptop. T
    15·1 answer
  • 1. Railroad tracks present no problems for a motorcyclist.
    8·1 answer
  • Gray London is a retired race car driver who helped Dale Earnhardt, Jr. get his start. He is writing a book and making a video a
    9·1 answer
  • Which of the following statements is TRUE of a peer-to-peer network?
    10·1 answer
  • Who is big brain me or you
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!