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
jekas [21]
4 years ago
11

Write the function listBuilder(l1, length) that takes a list of strings called l1 and an int called length and returns another l

ist that contains all the strings in l1 that have a length of at least length.Example:Input Outputl1 = ["Hello", "I", "am", "a", "list"] length = 4 ["Hello", list"]l1 = ["Homework", "is", "fun"] length = 8 ["Homework"]l1 = ["CS103", "is", "the", "best"} length = 8 []
Computers and Technology
1 answer:
Grace [21]4 years ago
7 0

Answer:

The solution code is written in Python 3:

  1. def listBuilder(l1, length):
  2.    result = []
  3.    for x in l1:
  4.        if(len(x) >= length):
  5.            result.append(x)
  6.    return result

Explanation:

Firstly, we create a variable result to hold the list will be returned at the end of the function. (Line 1)

Next, we create a for-loop to traverse the string in the l1 list (Line 4) and check for each string if their length is equal or bigger than the input length (Line 5). If so, we use append method to add the string to the result list.

At the end, return the result list as output (Line 8).

You might be interested in
Which layout manager constructor call would be best-suited to create a telephone handset GUI which has three rows of three keys
Snezhnost [94]

Answer:

The correct option : b. new GridLayout(4,3)

Explanation:

The total number of rows are 4 and total number of columns are 3.

So the total keys can be added is 4*3=12. This is suited for telephone keypad.

7 0
3 years ago
Which of the following are incident priorities?
xenn [34]

Answer:

what are the options?

reply in comment so i can help:)

5 0
3 years ago
Which is said to be ‘computer on a chip’ (a) Micro processors (b) Microcontrollers (c) Both (c) None of the above
fiasKO [112]
I think the answer would be A
5 0
3 years ago
When you record a macro, you can assign it to run from a button or from the _____.
arsen [322]
Depends on what software you use and how you set it up. But yea it’s possible
3 0
4 years ago
Read 2 more answers
Backing up data on a computer means
aleksklad [387]

Answer: when you back data up you are copying it and then moving the copy to another storage device

6 0
4 years ago
Read 2 more answers
Other questions:
  • Which tag provides information about a web site?
    12·1 answer
  • A palindrome is any word, phrase, or sentence that reads the same forward and backward. Here are some well-known palindromes: Ab
    11·1 answer
  • What is considered to be the core of the Unix operating system ?
    14·1 answer
  • Being able to express your thoughts in an email is a primary technology skill. true or false.
    9·2 answers
  • In the function below, use a function from the random module to return a random integer between the given lower_bound and upper_
    10·1 answer
  • In the space provided, analyze the pros and cons of becoming a member of an artistic guild. Your answer should be at least 150 w
    12·1 answer
  • Enter the word that belongs in the blank:
    13·1 answer
  • Which of the following items can you locate in a document using the navigation pane? Choose the answer.
    10·1 answer
  • You are the IT administrator for a small corporate network. The network uses a DHCP server for IP address configuration for most
    13·1 answer
  • in the topology configuration, hosts are connected to each other through a central controller which assumes all responsibility f
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!