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
You just purchased a single license for the latest Microsoft Office Suite. Your friend has asked to borrow the CD, so he can ins
TiliK225 [7]

Answer:

B

Explanation:

No, this would be piracy. If he would want to install it, he would have to buy it himself.

Hope this helps :D

6 0
3 years ago
Which type of financial institution typically has membership requirements?
Anon25 [30]
Credit Union typically has membership requirements
8 0
3 years ago
Which binary signaling technique uses a scheme in which zero voltage represents a 0 bit and the voltage for a 1 bit does not dro
prisoha [69]

Answer:

In binary signaling, Non Return to Zero (NRZ) is the technique in which zero voltage is represented by 0 bit while high voltage is represented by 1 until the voltage level change from high to low.

Explanation:

There are different techniques to encode the signal for transmission between transmitter and receiver. These techniques includes return to zero, non return to zero. In return to zero technique, the if the voltage is high the signal will become 1 for half of the time period and then after half time period it return to 0.

In NRZ the signal is 0 if the voltage level is zero. In case of high voltage of the signal the binary bit remains 1 until the next zero voltage level arrive in the signal until the end of the time period of bit.

6 0
4 years ago
Based on a kc value of 0.150 and the data table given, what are the equilibrium concentrations of xy, x, and y, respectively?
lidiya [134]

If the solution process is endothermic, then an increase in temperature usually results in an increase in solubility. Their heat of reaction is usually positive. The rest of the choices do not answer the question above.

4 0
3 years ago
Which option will enable Mina to apply several formats to the spreadsheet cells at the same time?
madam [21]
Applying a cell style will enable Mina to apply several formats to the spreadsheet cells at the same time.  <span>To apply several formats in one step, and to make sure that cells have consistent formatting, you can use a cell style. A cell style is a defined set of formatting characteristics, such as fonts and font sizes, number formats, cell borders, and cell shading. </span>
4 0
3 years ago
Other questions:
  • What would be the desired output of a home security system?
    6·1 answer
  • A(n) __________________ device is a breath analyzer on your vehicle that is electronically connected to the ignition.
    11·1 answer
  • What menu allows you to look up a command and learn how to use it?
    14·1 answer
  • The conscious process of planning and controlling how you spend your time is called?
    15·1 answer
  • Given that two int variables, total and amount, have been declared, write a sequence of statements that: initializes total to 0
    14·1 answer
  • Which of the actions below will not create more room on your hard drive?
    13·1 answer
  • Which formula is a complex formula?<br> =D6/E10<br> =10-(A3-D13)<br> =C3+10+E3<br> =5+A1*B1
    12·2 answers
  • When would you use the AutoFit to Contents option?
    15·1 answer
  • 4. In a relational database, entities are defined by
    6·1 answer
  • When we connect to a story, it can be mental, emotional, or even physical. <br> True or False?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!