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
inessss [21]
3 years ago
12

The function below takes a single argument: data_list, a list containing a mix of strings and numbers. The function tries to use

the Filter pattern to filter the list in order to return a new list which contains only strings longer than five characters. The current implementation breaks when it encounters integers in the list. Fix it to return a properly filtered new list.student.py HNM 1 - Hef filter_only_certain_strings (data_list): new_list = [] for data in data_list: if type (data) == str and len(data) >= 5: new_list.append(data) return new_list Restore original file Save & Grade Save only
Computers and Technology
1 answer:
Nataliya [291]3 years ago
6 0

Answer:

Explanation:

The Python code that is provided in the question is correct just badly formatted. The snippet of code that states

return new_list

is badly indented and is being accidentally called inside the if statement. This is causing the function to end right after the first element on the list regardless of what type of data it is. In order for the code to work this line needs have the indentation removed so that it lines up with the for loop. like so... and you can see the correct output in the attached picture below.

def filter_only_certain_strings(data_list):

   new_list = []

   for data in data_list:

       if type(data) == str and len(data) >= 5:

           new_list.append(data)

   return new_list

You might be interested in
Write the code to create a variable score and assign it the value 0?​
Galina-37 [17]

Answer:

You can assign a value to a routine variable in any of the following ways:

Use a LET statement.

Use a SELECT INTO statement.

Use a CALL statement with a procedure that has a RETURNING clause.

Use an EXECUTE PROCEDURE INTO or EXECUTE FUNCTION INTO statement.

Explanation:

4 0
3 years ago
What are the special features of fifth generation that makes it different from the other generations?​
Salsk061 [2.6K]

Answer:

The answer to this question is given below in this explanation section.

Explanation:

               "features of fifth generation"

The fifth generation computer system was an initiative by japans ministry of international trade and industry,begun in 1982,to create computer using massively parallel computing and logical programming.It was to be the result of massive government industry research project in japan during the 1980.It aimed to create an epoch making computer with supercomputer liked performance and to provide a platform for future development in artificial intelligence.There was also an unrelated Russian project also named as the fifth generation computer.

The term fifth generation was untended to convey the system as being a leap beyound existing machines.In the history of computing hardware,computer using vacuum tubes were called the first generation;transistors and diodes,the second;integrated circuits,the third;and those using microprocessors,the fourth.Whereas previous computer generation had focused on increasing the number of logic elements in a single CPU,the fifth generation,it was instead turn to massive numbers of CPU for added performance.

5 0
3 years ago
Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a Master-Detail relationship with the
Rudik [331]

Answer:

The account record comprises of Invoice roll up summary fields.

Explanation:

The possible reason that this change was not permitted was that the account record comprises of Invoice roll up summary fields.

Invoice roll up summary fields: A roll-up summary field computes values from associated records, for example those in a linked list. a person or someone ca design a roll-up summary field to show a value in a master record by building  the values of fields in a particular record.

The detail record must be associated to the master through a master-detail relationship. for instance, you want to show the sum of invoice amounts for all linked custom object records in an account’s Invoices related list. you can show the whole or sum in a custom account field refereed to as Total Invoice Amount.

4 0
3 years ago
"a technician claims to have crimped a patch cable according to the T568A standard on one e d and T568B on the other"
yanalaym [24]

Answer:

The technician has made a cross-over cable.

Explanation:

The network is a platform that provides two or more computers to communicate. There different types of networks, namely, local-area network (LAN), wide-area network (WAN), MAN or metropolitan-area network etc.

Devices in a network can be connected with cables (ethernet IEEE 802.3) or wirelessly (wifi IEEE 802.11a/n/g). Wiring standards are strictly followed in ethernet configuration.

Two ethernet wiring standards are T568A and T568B. The difference in both standards are the pin configuration and their position in a wire defines a cable system.

When a T568A or T568B are used on both ends of a twisted pair cable, it is called a straight-through cable. When T568A is used on one end and T568B on the other, it is called a cross-over cable.

These cable systems are used for different applications. the straight-through cable is used for connecting devices that are not the same like router to switch, switch to computer etc. The cross-over cable connects similar network devices like router to router, switch to switch etc.

3 0
3 years ago
When is a handrail required for stairs
ch4aika [34]

Answer: when is not able to get up the stairs like a normal person

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Windows Hello supports multiple biometric authentication methods, including facial recognition. What is the failsafe method to a
    6·1 answer
  • Write a program that reads a 4-bit binary number from the keyboard as a string and then converts it into decimal. For example, i
    11·1 answer
  • What does the regular expression [a-z0-9\-] mean?
    8·1 answer
  • Which fraction represents the shaded part of this circle? 1 2 O 4 Check Answer /3rd grade/​
    14·2 answers
  • What adaptation Judy and her parents have that help them run from predators coming?​
    6·1 answer
  • A 90-minute film is based on a fictional couple. They are very happy throughout the entire film. The film shows how they met, wh
    5·2 answers
  • A large number of genetic codes are stored as binary values in a list. Which one of the following conditions must be true in ord
    5·2 answers
  • One rule in the Java programming language is that you have to place a semicolon at the end of each statement. What is this rule
    10·2 answers
  • What are web protocols.
    14·2 answers
  • PLEASE HELP
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!