Answer:
For any string, we use 
Explanation:
The pumping lemma says that for any string s in the language, with length greater than the pumping length p, we can write s = xyz with |xy| ≤ p, such that xyi z is also in the language for every i ≥ 0. For the given language, we can take p = 2.
Here are the cases:
- Consider any string a i b j c k in the language. If i = 1 or i > 2, we take
and y = a. If i = 1, we must have j = k and adding any number of a’s still preserves the membership in the language. For i > 2, all strings obtained by pumping y as defined above, have two or more a’s and hence are always in the language.
- For i = 2, we can take and y = aa. Since the strings obtained by pumping in this case always have an even number of a’s, they are all in the language.
- Finally, for the case i = 0, we take
, and y = b if j > 0 and y = c otherwise. Since strings of the form b j c k are always in the language, we satisfy the conditions of the pumping lemma in this case as well.
Answer:
Complete question is:
write the following decorators and apply them to a single function (applying multiple decorators to a single function):
1. The first decorator is called strong and has an inner function called wrapper. The purpose of this decorator is to add the html tags of <strong> and </strong> to the argument of the decorator. The return value of the wrapper should look like: return “<strong>” + func() + “</strong>”
2. The decorator will return the wrapper per usual.
3. The second decorator is called emphasis and has an inner function called wrapper. The purpose of this decorator is to add the html tags of <em> and </em> to the argument of the decorator similar to step 1. The return value of the wrapper should look like: return “<em>” + func() + “</em>.
4. Use the greetings() function in problem 1 as the decorated function that simply prints “Hello”.
5. Apply both decorators (by @ operator to greetings()).
6. Invoke the greetings() function and capture the result.
Code :
def strong_decorator(func):
def func_wrapper(name):
return "<strong>{0}</strong>".format(func(name))
return func_wrapper
def em_decorator(func):
def func_wrapper(name):
return "<em>{0}</em>".format(func(name))
return func_wrapper
@strong_decorator
@em_decorator
def Greetings(name):
return "{0}".format(name)
print(Greetings("Hello"))
Explanation:
Answer:
b. 1232.08 km/hr
c. 1.02 kn
Explanation:
a) For dynamic similar conditions, the non-dimensional terms R/ρ V2 L2 and ρVL/ μ should be same for both prototype and its model. For these non-dimensional terms , R is drag force, V is velocity in m/s, μ is dynamic viscosity, ρ is density and L is length parameter.
See attachment for the remaining.