Page 122 - Plus V4 with Adobe class 8
P. 122
3. The _______________ function converts all uppercase letters to lowercase.
4. A consecutive sequence of characters which are enclosed or surrounded by single or double quotes
is known as a _______________ .
Q Answer the following questions:
A
1. What is the use of functions?
2. What do you mean by traversing a string?
3. How can we call a function in Python? Explain using an example.
4. What are the different types of functions? Explain in detail.
5. Write any two built-in functions to manipulate strings.
Scratch Your Brain. Century #Critical Thinking
21 st
Skills
1. Write the output of the following programs:
a. test_str = "Good Morning"
print("The original string is : " + test_str)
hlf_idx = len(test_str)
res = ' '
for idx in range(len(test_str)):
if idx >= hlf_idx:
res+= test_str[idx].upper()
else:
res+= test_str[idx].upper()
print("The resultant string : " + test_str)
b. def countX(st, X):
count = 0
for ele in st:
if(ele==X):
count = count + 1
return count
st = "Orange Education"
X = 'a'
print(X,"has occurred", countX(st, X), "times")
120 Plus (Ver. 4.0)-VIII

