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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Def info(object, spacing=10, collapse=1):# function headerconsider the following function call and find out whether it is validinfo(obj3, collapse=0)
2. What is the output of the following code:'print((lambda x, y:x + y)(10, 5))'?
3. What will be the output of the following code? "'pythondef greet(name="Guest"):return "Hello, '' + nameprint(greet()) "'
4. A ..... is a block of code that will execute only when it is called.
5. What will points.count(9) return if points = [1, 4, 2, 9, 7, 8, 9, 3, 1]?
6. What is the output of the following code? def my ..... func():print('hello, Good Morning'); my ..... func()
7. Which of the following best describes a parameter in a function?
8. What is the output of a function that returns a list?
9. What are the advantages of using lambda functions in Python?
10. Which of the following items are present in the function header?
11. Which of the following is an example of a non-parameterized function?
12. The program may run out of memory in a
13. What will this code print?def hello():print("Hi")hello()
14. How do you create a multi-line string in Python?
15. A variable defined outside all functions is known as
16. What does the ..... name ..... variable indicate when a module is imported?
17. What is the default return value of a function that does not return any value explicitly?
18. What is the scope of a variable defined inside a function in Python?
19. Name the condition at which the recursive method will stop calling itself.
20. Choose the correct form of function.
21. What will be the output of the following code? "'pythondef add(a, b):return a + bresult = add(3, 4)print(result) "'
22. Which of the following is true about the lifetime of a variable in Python?
23. What does the keyword return do in a Python function or subroutine?
24. A named blocks of code that are designed to do one specific job is called as
25. If a function is defined but never called, what will happen?