Class 11 Computer Science Chapter 5 Functions In Python Quiz 9 (25 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. A ..... is a variable that is created inside a function.
2. What does the index() method return?
3. If you want to find the maximum value in a list, which method would you use?
4. Which of the following is the correct way to catch any exception in Python?
5. What will be printed by the following code? "'pythondef test():y = 5 print(y)test()print(y) "'
6. How can you convert a string to uppercase in Python?
7. Predefined functions that are already available in Python are known as
8. Which of the following is used to return a result from a function?
9. Which of the following keyword is used to begin the function block?
10. Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?
11. What is the purpose of using subroutines in programming?
12. What is the output of the following code? def print ..... is ..... positive(n):if n > 0:print('Positive'); else:print('Negative'); print ..... is ..... positive(-5)
13. A Function that does not have any return value is known as .....
14. What is a parameter in the context of functions?
15. What is the output of the following code:'print((lambda x:x**2)(5))'?
16. What is the output of the function shown below (random module has already been imported)?random.choice('sun')
17. What does the function sqrt(x) return?
18. Function may or may not return a value
19. The ..... of a variable is the area of a program where it may be referenced
20. Which of the following is TRUE about global variables?
21. What is the format for writing a value-returning function?
22. What does the following function return? "'pythondef test():passprint(test()) "'
23. What happens if the function is not called?
24. The code block of function always comes after a .....
25. Assertion (A):Built in function are predefined in the language that are used directlyReason (R):print( ) and input( ) are built in functions