Engineering
08.10.2022 04:56
136
312
4
Solved by an expert

The function below takes a single argument: data_list, a list containing a mix of

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.
Show Answers
naeaamm2528
naeaamm2528
4,7(74 marks)

def filter_only_certain_strings(data_list):

   new_list = []

   for data in data_list:

       # fix here. change >= to >  

       # because we want to return strings longer than 5 characters in length.

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

           new_list.append(data)

   return new_list

Explanation:

def filter_only_certain_strings(data_list):

   new_list = []

   for data in data_list:

       # fix here. change >= to >  

       # because we want to return strings longer than 5 characters in length.

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

           new_list.append(data)

   return new_list

purplebandit96
purplebandit96
5,0(96 marks)

a. Photosynthesis

b. Oxygen

c. Light from the lamp

Explanation:

a. The process that is occurring in the plant's cell to produce the gas in the bubble is photosynthesis. The process involves the use of inorganic substances such as carbon dioxide and water in the presence of light to manufacture carbohydrates. Oxygen is evolved in the process. The equation for the process is as below:

6 CO_2 + 6 H_2O + light -- C_6H_1_2O_6 + 6 O_2

b. The gas produced by the plant is oxygen as shown in the equation above.

c. The source of energy the plant is using to conduct the process is the light from the lamp. Light catalyzes the excitation of photosystems, causing the release of electrons that causes the splitting of water.

Popular Questions about the subject: Engineering

Explain and justify why the engineers who designed the Bird s Nest used trusses...
Engineering
29.06.2020 06:42
Name an event that occurred because the wrong system of measurement was used....
Engineering
09.12.2022 13:35
Can I just say the spelling error that Odyssey had XD. They said “$15 dollars...
Engineering
23.09.2022 14:10
Given below are the measured streamflows in cfs from a storm of 6-hour duration...
Engineering
19.09.2020 00:18
A ceramic specimen with an elastic modulus of 300 GPa is under a tensile stress...
Engineering
27.12.2020 20:51
The 50-lb plate ABCD is attached at A and D to collars that can slide on the...
Engineering
08.06.2022 14:58
Which of the following explains why the Eiffel Tower does not require large and...
Engineering
10.03.2020 16:06
The scientific method is a (blank) way to find answers to (blank) or (blank)...
Engineering
01.11.2021 03:55
It is essential to wait until the end of the project to check if the sponsor/customer...
Engineering
07.04.2022 07:39
Please answer got 2 minutes​...
Engineering
26.09.2021 16:15

New questions by subject

1 Smurf = 3 Snorks 1 Snork = 6 Pookas 8 Pookas = 1 Flintstone1 Smurf = 3 Snorks...
Chemistry
24.01.2020 15:54
Souviens-toi de ces murs que j ai construits Eh bien, bébé, ils s écroulent Et...
Arts
27.05.2020 16:04
Urgent! please help ahh In this unit, you learned a variety of animal and pet...
Spanish
10.04.2020 23:30
Why does the US import oil? because it does not produce thy oil because it has...
Business
04.11.2021 00:55
your keywords are not providing the search results you wanted.you should try...
Geography
23.11.2022 06:18
All pictures are below please help Sandi had the following problem on her math...
Mathematics
21.10.2020 08:21
Choose the definition for the function...
Mathematics
22.08.2021 14:26
Who decides whether to charge a suspect with a crime ?...
Law
11.06.2022 10:14
Some help would be great (:...
Mathematics
03.09.2021 10:45
#
#
#
#
# #

We expand our knowledge with many expert answers