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
Data silos are often associated with ________________.
amid [387]

Answer:

Option b the development of one or a few related analytics applications.

Explanation:

Data silo is the isolated information in an organization which is not shared across different departments. Data silo could exist because one department in an organization may not see the necessity to share information to other department. Or the information is deemed as unique data which is dedicated  to develop one or a few very specific analytics applications.  Data silos should be minimized if an organization intends to develop a data analytics system that support in enterprise wide level.

7 0
3 years ago
What is the number system that uses only the numbers 0 and 1?
Bingel [31]
It is c because its C
4 0
3 years ago
Suppose a switch is built using a computer work station and that it can forward packets at a rate of 500,000 packets per second,
Marina86 [1]

Answer:

When the transmission exceeds 667 packets

Explanation:

In computer networking, a packet is a chunk of data transmitted across the network. The packet size of an Ethernet network is 1.5kilobytes, while the packet size of an IP packet payload is 64 kilobytes.

A switch is a physical network device that connects nodes or workstations while communicating the packets (or frames). The I/O bus size bandwidth is 1Gbps which allows approximately 667 packets. Once this packet size is crossed, the bus becomes a limiting factor or bottle neck.

3 0
3 years ago
What is computer software
Butoxors [25]
A set of instructions and documents that tells a computer what to do or how to perform a task or it can mean all the software on a computer,
7 0
3 years ago
Read 2 more answers
How do you make an app for help
timama [110]
If you have a iPhone say "108" to Siri it will auto make an app
5 0
3 years ago
Read 2 more answers
Other questions:
  • Diane wants to maintain a record of grades she scored in the fifth, sixth, and seventh grades. She enters her grades and the tot
    15·2 answers
  • Social networking sites like Office Online, PayPal, and Dropbox are used to develop social and business contacts.
    6·2 answers
  • . When you create a template class, ___________.
    15·1 answer
  • Write a function M-file that takes as input two matrices A and B, and as output produces
    8·1 answer
  • If a person sends email from a school computer or a business computer, should that message be considered private?
    8·2 answers
  • The letters a, e, i, o and u are the only vowels. Write a function named vowelUseDict() takes a string t as a parameter and comp
    7·1 answer
  • When a computer or digital device is used as a storage device or in the facilitation of an offense, it is argued to be ____ to t
    14·1 answer
  • WHAT IS MULTIMEDIA SUPPOSED TO MEAN ???
    15·2 answers
  • If the tax percent is 15% and tax is $36 and percent discount is 10, what is the cost price?​
    12·1 answer
  • If an internet document identifies its author but says nothing about her or his qualifications, your textbook recommends that yo
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!