12 CS WorkSheet 02 Apr24
12 CS WorkSheet 02 Apr24
a) It is a program module
b) It is a reusable piece of a program
c) You cannot create your own function
d) All of the above
2. Which of the following is the most suitable for the return statement?
4. What is the default return value when a function does not return any value explicitly?
11. Write a Python code to accept a string from the user. Pass the string to a function
def Change(s) which displays the first character of each word after changing the case
(lower to upper and vice versa).
Sample Input: Delhi public school
Sample Output:
d
P
S
12. Write Python code to accept ten different names in a list and pass the list to a function def Search(MyList).
Enter a number in the function block and check whether the number is present or not by using ‘Linear Search
Technique’.
If the number is present then display ‘Search is successful’, otherwise display ‘Search is unsuccessful’.