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

Quiz Instructions

Select an option to see the correct answer instantly.

1. While defining a function which of the following symbol is used?
2. What will be the output of the following code snippet?print(type(5 / 2))print(type(5 // 2))
3. Which of the following is a valid way to call a function named 'calculate' in Python?
4. What will be printed by the following code? "'pythondef foo(x):if x < 0:return "Negative" else:return "Non-negative"print(foo(-5)) "'
5. This statement causes a function to end and sends a value back to the part of the program that called the function.
6. What is the output of the following code:'print((lambda x, y:x-y)(5, 3))'?
7. What is the output of the function call sums() if sums() returns 30?
8. Ananya is trying to understand the features of Python functions. She is not understanding the feature that distributes the work in small parts. Select the appropriate term out of the following.
9. Why is the number 20 not part of the list generated by list(range(2, 20, 2))?
10. What will the following code output? def even ..... odd():no = int(input('Enter a number:')); if no % 2 == 0:print('Even') else:print('Odd')
11. What is the purpose of the 'return' keyword in a function?
12. Which method would you use to insert an element at a specific position in a list?
13. How can you return multiple values from a function in Python?
14. Which of the following function headers is correct?*
15. Which of the following is a valid function definition in Python?
16. When possible, you should avoid using ..... variables in a program.
17. What does the function round(x, n) do in Python?
18. Out of the following, find those identifiers, which cannot be used for naming functions in a Python program:While, 3rd Row, def, My ..... Sp
19. Select output given by the following code:a = \{i * i for i in range(6)\}print(a)
20. What does the keyword 'def' signify in Python?
21. In Python function can return only one value.
22. What does the following function return? "'pythondef multiply(x, y=2):return x * yprint(multiply(4)) "'
23. Which of the following is a correct way to use the map function to double each element in a list?
24. If we write def add(a, b):return a + b, what will add(2, 3) give?
25. Read the following statement and choose the correct statement(s)1.In python, you don't have to mention the specific data types while defining function2.Python keywords can be used as function names