This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 5 Functions In Python – Quiz 3 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 5 Functions In Python Quiz 3 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Which of the following is a valid function name? A) Start game(). B) Start game. C) Start-game(). D) All of the above. Show Answer Correct Answer: A) Start game(). 2. The values being passed through a function-call statement are called ..... A) Arguments. B) Parameter. C) Values. D) None. Show Answer Correct Answer: A) Arguments. 3. What is returned by math.ceil(3.4)? A) 3. B) 4. C) 4.0. D) 3.0. Show Answer Correct Answer: B) 4. 4. Select the advantages of functions A) Modular programming. B) Code re-usability. C) Improving clarity of the code. D) All the above. Show Answer Correct Answer: D) All the above. 5. What will be the output of the following code? "'pythondef is ..... even(number):return number % 2 == 0result = is ..... even(4)print(result) "' A) 'True'. B) 'False'. C) '0'. D) 'None'. Show Answer Correct Answer: A) 'True'. 6. What type of variable is declared inside a function? A) Instance Variable. B) Static Variable. C) Local Variable. D) Global Variable. Show Answer Correct Answer: C) Local Variable. 7. What is the output of the programx=50def func(x):x=2func(x)print("x value", x) A) 2. B) 50. C) 52. D) 48. Show Answer Correct Answer: B) 50. 8. Which of the following statements is false about recursion A) Every recursive function must have a base value. B) Infinite recursion can occur if the base case isn't properly mentioned. C) A recursive function makes the code short and simple. D) A recursive method is invoked differently from a non-recursive method. Show Answer Correct Answer: D) A recursive method is invoked differently from a non-recursive method. 9. What does the 'strip()' method do to a string? A) The 'strip()' method replaces all spaces with underscores. B) The 'strip()' method converts all characters to lowercase. C) The 'strip()' method removes leading and trailing whitespace from a string. D) The 'strip()' method splits a string into a list of words. Show Answer Correct Answer: C) The 'strip()' method removes leading and trailing whitespace from a string. 10. What is the output of the following Python code?num = 3print( float(num) ) A) Flaot(num). B) 3. C) 3.0. D) TypeError. Show Answer Correct Answer: C) 3.0. 11. What is a nested loop? A) A loop that runs indefinitely. B) A loop that defines a function. C) A loop inside another loop. D) A loop that checks conditions. Show Answer Correct Answer: C) A loop inside another loop. 12. What is the output of the following code:'list(map(lambda x:x**2, [1, 2, 3, 4]))'? A) [1, 4, 9, 16]. B) [1, 8, 27, 64]. C) [2, 4, 6, 8]. D) [1, 2, 3, 4]. Show Answer Correct Answer: A) [1, 4, 9, 16]. 13. What will be printed by the following code? "'pythondef add(a, b):return a + bprint(add(3, 5)) "' A) '8'. B) '35'. C) '3 + 5'. D) 'Error'. Show Answer Correct Answer: A) '8'. 14. Which of the following is NOT a benefit of using functions? A) Reusability. B) Increased complexity. C) Modularity. D) Readability. Show Answer Correct Answer: B) Increased complexity. 15. What is the purpose of the math module in Python? A) To perform mathematical calculations. B) To store functions. C) To create random numbers. D) To manage input and output. Show Answer Correct Answer: A) To perform mathematical calculations. 16. What is the purpose of a return statement in a function? A) To return a value. B) To call the function. C) To print output. D) To define the function. Show Answer Correct Answer: A) To return a value. 17. What will be the output of the following code? def display():print('program') display() A) Program. B) None. C) Error. D) Display. Show Answer Correct Answer: A) Program. 18. Assertion. A parameter having a default value in the function header is known as a default parameter.Reason. The default values for parameters are considered only if no value is provided for that parameter in the function call statement. A) Both A and R are true and R is the correct explanation of A. B) Both A and R are true but R is NOT the correct explanation of A. C) A is true but R is false. D) A is false but R is true. Show Answer Correct Answer: B) Both A and R are true but R is NOT the correct explanation of A. 19. Def info(object, spacing=10, collapse=1):# function headerconsider the following function call and find out whether it is validinfo(obj2, 12) A) Valid. B) Invalid. C) All the above. D) None of the above. Show Answer Correct Answer: A) Valid. 20. What is the output of the following code? def add(x, y):return x + y; print(add(2, 3)) A) 23. B) None. C) Error. D) 5. Show Answer Correct Answer: D) 5. 21. Def info(object, spacing=10, collapse=1):# function headerconsider the following function call and find out whether it is validinfo(spacing=20) A) Valid. B) Invalid. C) All the above. D) None of the above. Show Answer Correct Answer: B) Invalid. 22. What does the range() function in Python do? A) Creates a list of strings. B) Checks for conditions. C) Generates a sequence of numbers. D) Defines a loop. Show Answer Correct Answer: C) Generates a sequence of numbers. 23. What is the primary purpose of a for loop in Python? A) To define a function. B) To iterate over items in a sequence. C) To create a variable. D) To handle exceptions. Show Answer Correct Answer: B) To iterate over items in a sequence. 24. What is the correct way to define a function that multiplies two numbers? A) Def mult(x, y):. B) Def mult(x, y):. C) Def mult(x, y). D) Def mult x, y:. Show Answer Correct Answer: A) Def mult(x, y):. 25. How do you call a function in Python? A) Function(arguments). B) Function name[]. C) Call function(arguments). D) Function name(arguments). Show Answer Correct Answer: D) Function name(arguments). ← PreviousNext →Related QuizzesClass 11 Computer Science Chapter 5 Functions In Python Quiz 1Class 11 Computer Science Chapter 5 Functions In Python Quiz 2Class 11 Computer Science Chapter 5 Functions In Python Quiz 4Class 11 Computer Science Chapter 5 Functions In Python Quiz 5Class 11 Computer Science Chapter 5 Functions In Python Quiz 6Class 11 Computer Science Chapter 5 Functions In Python Quiz 7Class 11 Computer Science Chapter 5 Functions In Python Quiz 8Class 11 Computer Science Chapter 5 Functions In Python Quiz 9Class 11 Computer Science Chapter 5 Functions In Python Quiz 10Class 11 Computer Science Chapter 5 Functions In Python Quiz 11 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books