This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 5 Functions In Python – Quiz 10 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 5 Functions In Python Quiz 10 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. The first line of a function definition is known as the ..... A) Body. B) Introduction. C) Header. D) Initialization. Show Answer Correct Answer: C) Header. 2. Recall what will a function return if there is no return statement. A) 0. B) None. C) Error. D) Empty String. Show Answer Correct Answer: B) None. 3. Def fun1(a, b):return a+b, a=b, a*b, a/ba=fun1(10, 2)Here a will be created as A) String. B) List. C) Tuple. D) Dictionary. Show Answer Correct Answer: C) Tuple. 4. How can you check the type of a variable in Python? A) Use the 'type()' function. B) Use the 'instanceof' operator. C) Use the 'var type()' function. D) Check the variable's memory address. Show Answer Correct Answer: A) Use the 'type()' function. 5. Which Python function returns the length of a string or a list? A) Max(). B) Min(). C) Len(). D) Range(). Show Answer Correct Answer: C) Len(). 6. Assertion. A parameter having a default in function header becomes optional in function call.Reason. A function call may or may not have values for default arguments. 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: A) Both A and R are true and R is the correct explanation of A. 7. Predict the output, if the value passed for the given function is 2.def game(x):return 4**x A) 8. B) X x. C) 16. D) 4 4. Show Answer Correct Answer: C) 16. 8. What type of argument is passed during function definition? A) Default Argument. B) Actual Argument. C) Formal Parameter. D) Positional Argument. Show Answer Correct Answer: C) Formal Parameter. 9. What is the purpose of the 'break' statement in Python? A) To skip the rest of the code in the loop and continue with the next iteration. B) To terminate the loop and transfer control to the next statement. C) To execute a set of statements repeatedly based on a condition. D) To define a new variable. Show Answer Correct Answer: B) To terminate the loop and transfer control to the next statement. 10. Read the following statements and then select the answer:Statement A:Default arguments can be used to add new parameters to the existing functionsStatement B:Default arguments can be used to combine similar functions into one A) Statement A is correct. B) Statement B is correct. C) Both are correct. D) Both are incorrect. Show Answer Correct Answer: C) Both are correct. 11. What is the output of the following Python code?print(round(51.6)) A) 51.6. B) 52. C) 51. D) Round(51.6). Show Answer Correct Answer: B) 52. 12. What will be the output of the following code? "'pythondef max ..... value(a, b):if a > b:return a else:return bresult = max ..... value(5, 10)print(result) "' A) '10'. B) '5'. C) '0'. D) 'None'. Show Answer Correct Answer: A) '10'. 13. What is the output of the following code? def main():print('This is python'); main() A) None. B) Error. C) Main. D) This is python. Show Answer Correct Answer: D) This is python. 14. What is the order of resolving scope of a name in a python program? A) B E G L. B) G E B L. C) L E G B. D) L B E G. Show Answer Correct Answer: C) L E G B. 15. What is the output of the following code? def add(j):if(j>=4):j=j*j else:j=j*2 return j; print(add(5)) A) 25. B) 10. C) 5. D) Error. Show Answer Correct Answer: A) 25. 16. Which of the following is a valid use of a lambda function? A) Defining a class. B) Creating a complex multi-line function. C) Writing a quick, throwaway function. D) Handling file input/output. Show Answer Correct Answer: C) Writing a quick, throwaway function. 17. Which of the following is a characteristic of a parameterized function? A) Does not take inputs. B) Takes one or more inputs. C) Always returns a value. D) None of the above. Show Answer Correct Answer: B) Takes one or more inputs. 18. A function can be with or without returning any values. A) True. B) False. C) All the above. D) None of the above. Show Answer Correct Answer: A) True. 19. What is the correct way to define a function that returns nothing? A) 'def myFunction():pass'. B) 'def myFunction():return'. C) 'def myFunction():return None'. D) All of the above. Show Answer Correct Answer: D) All of the above. 20. Which method reverses the order of elements in a list? A) Reverse(). B) Order(). C) Flip(). D) Sort(). Show Answer Correct Answer: A) Reverse(). 21. What happens if the base condition isn't defined in recursive programs? A) Program gets into an infinite loop. B) Program runs once. C) Program runs n number of times where n is the argument given to the function. D) An exception is thrown. Show Answer Correct Answer: A) Program gets into an infinite loop. 22. What is the output of the following code:'print((lambda x:x-2)(10))'? A) 8. B) 12. C) 2. D) 0. Show Answer Correct Answer: A) 8. 23. What is the term for a function that calls itself in Python? A) Recursive function. B) Iterative function. C) Loop function. D) Self function. Show Answer Correct Answer: A) Recursive function. 24. What does the 'find()' method return if the substring is not found? A) Null. B) -1. C) Undefined. D) 0. Show Answer Correct Answer: B) -1. 25. Which of the following problems can be solved using recursion? A) Finding Nth number of the Fibonacci sequence. B) Finding the factorial of a number. C) Finding the length of a string. D) All of the above. Show Answer Correct Answer: D) All of the above. ← 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 3Class 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 11 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books