# 5.2 Itse1359-1850-regular expressions  (Page 2/4)

 Page 2 / 4
Figure 2 . Question 6.
```def prod(a,b): return a*bdef sum(c,d): return c+dcomp = lambda w,x,y,z : sum(w,x) * prod(y,z) print(comp(3,4,5,6))=============================================================================== 210```

## Question 7

True or False? The code in the top panel of Figure 3 produces the output shown in the bottom panel of Figure 3 .

Figure 3 . Question 7.
```highNumbers = list(filter((lambda x: x>5), range(10))) print(highNumbers)=============================================================================== [5, 6, 7, 8, 9]```

## Question 8

True or False? The code in the top panel of Figure 5 produces the output shown in the bottom panel of Figure 5 .

Figure 5 . Question 8.
```import re str = "abcd\$"if re.search(r'[ceg\$]', str):print("Match") else:print("No Match") if re.search(r'[^abcd\$]', str): print("Match")else: print("No Match")=============================================================================== MatchMatch```

## Question 9

True or False? The code in the top panel of Figure 7 produces the output shown in the bottom panel of Figure 7 .

Figure 7 . Question 9.
```import re s = "pqrabcdefg-abcd-abc\$"matches = re.findall(r'ab', s) for substr in matches:print(substr) searchObj = re.search(r'ab', s)if searchObj: print(str(searchObj.start()) + "-" + str(searchObj.end()))=============================================================================== abab ab3-5```

## Question 10

True or False? The code in the top panel of Figure 8 produces the output shown in the bottom panel of Figure 8 .

Figure 8 . Question 10.
```myList = [0,1,2,3,4,5,6] print(myList)print("ok") print(*myList)=============================================================================== [0, 1, 2, 3, 4, 5, 6]ok [0, 1, 2, 3, 4, 5, 6]```

## Question 11

Note: You will need to understand lambda and filter to understand the code in most of the remaining questions.

True or False? The code in the top panel of Figure 10 produces the output shown in the bottom panel of Figure 10 .

Figure 10 . Question 11.
```import re myList = ('Dick', 'TomDickHarry', 'Dick is my name')for testString in myList: print("Test string:",testString)lambdaFunction = lambda arg: re.search(r"Dick", arg) matchObject = lambdaFunction(testString)if(matchObject!=None): print(" Matching subString:",matchObject.group())=============================================================================== Test string: DickMatching subString: Dick Test string: TomDickHarryMatching subString: Dick Test string: Dick is my nameMatching subString: Dick```

## Question 12

True or False? The code in the top panel of Figure 11 produces the output shown in the bottom panel of Figure 11 .

Figure 11 . Question 12.
```import re myList = ('Dick', 'TomDickHarry', 'Dick is my name')for testString in myList: print("Test string:",testString)lambdaFunction = lambda arg: re.match(r"Dick", arg) matchObject = lambdaFunction(testString)if(matchObject!=None): print(" Matching subString:",matchObject.group())=============================================================================== Test string: DickMatching subString: Dick Test string: TomDickHarryMatching subString: Dick Test string: Dick is my nameMatching subString: Dick```

general equation for photosynthesis
6CO2 + 6H2O + solar energy= C6H1206+ 6O2
Anastasiya
meaning of amino Acids
a diagram of an adult mosquito
what are white blood cells
white blood cell is part of the immune system. that help fight the infection.
MG
Mlungisi
Cells with a similar function, form a tissue. For example the nervous tissue is composed by cells:neurons and glia cells. Muscle tissue, is composed by different cells.
Anastasiya
I need further explanation coz celewi anything guys,,,
hey guys
Isala
on what?
Anastasiya
hie
Lish
is air homogenous or hetrogenous
homogenous
Kevin
why saying homogenous?
Isala
explain if oxygen is necessary for photosynthesis
explain if oxygen is necessary for photosynthesis
Yes, the plant does need oxygen. The plant uses oxygen, water, light, and produced food. The plant use process called photosynthesis.
MG
By using the energy of sunlight, plants convert carbon dioxide and water into carbohydrates and oxygen by photosynthesis. This happens during the day and sunlight is needed.
NOBLE
no. it s a product of the process
Anastasiya
yet still is it needed?
NOBLE
no. The reaction is: 6CO2+6H20+ solar energy =C6H12O6(glucose)+602. The plant requires Carbon dioxyde, light, and water Only, and produces glucose and oxygen( which is a waste).
Anastasiya
what was the question
joining
Godfrey
the specific one
NOBLE
the study of non and living organism is called.
Godfrey
Is call biology
Alohan
yeah
NOBLE
yes
Usher
what Is ecology
what is a cell
A cell is a basic structure and functional unit of life
Ndongya
what is biolgy
is the study of living and non living organisms
Ahmed
may u draw the female organ
i dont understand
Asal
:/
Asal
me too
DAVID
anabolism and catabolism
Anabolism refers to the process in methabolism in which complex molecules are formed "built" and requires energy to happen. Catabolism is the opposite process: complex molecules are deconstructed releasing energy, such as during glicolysis.
Anastasiya
Explain briefly independent assortment gene .
hi
Amargo
hi I'm Anatalia
Joy
what do you mean by pituitary gland
Digambar
Got questions? Join the online conversation and get instant answers!