This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 5 Functions In Python – Quiz 11 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 5 Functions In Python Quiz 11 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. What will be the output of the following code? "'pythondef remainder(a, b):return a % bresult = remainder(10, 3)print(result) "' A) '1'. B) '3'. C) '0'. D) 'None'. Show Answer Correct Answer: A) '1'. 2. What is the purpose of using lambda functions in Python? A) The purpose of using lambda functions in Python is to reduce code complexity. B) The purpose of using lambda functions in Python is to improve code readability. C) The purpose of using lambda functions in Python is to create anonymous functions. D) The purpose of using lambda functions in Python is to increase code performance. Show Answer Correct Answer: C) The purpose of using lambda functions in Python is to create anonymous functions. 3. How does a function differ from a subroutine? A) A. Functions and subroutines are the same. B) B. Functions are only used for math operations, while subroutines handle general tasks. C) C. Functions can return a value, while subroutines do not. D) None of the above. Show Answer Correct Answer: C) C. Functions can return a value, while subroutines do not. 4. How can you convert a string to lowercase? A) Use the .toUpperCase() method in Java. B) Convert the string using string.replace() method. C) Use the .uppercase() method in Python. D) Use the .lower() method in Python or the .toLowerCase() method in JavaScript. Show Answer Correct Answer: D) Use the .lower() method in Python or the .toLowerCase() method in JavaScript. 5. Def aver(a, b, c=10):return (a+b+c)/3requires ..... arguments compulsorily A) 2. B) 3. C) 1. D) 0. Show Answer Correct Answer: A) 2. 6. What is the output of the following code? def display():print('program'); display() A) Program. B) Error. C) Display. D) None. Show Answer Correct Answer: A) Program. 7. Richa is working with a program where she gave some values to the function. She doesn't know the term to relate these values. Select the correct option. A) Function value. B) Arguments or parameters. C) Return values. D) Function call. Show Answer Correct Answer: B) Arguments or parameters. 8. What does the max() function in Python do? A) It returns the smallest of its arguments. B) It returns the largest of its arguments. C) It returns the length of a string. D) It generates a sequence of numbers. Show Answer Correct Answer: B) It returns the largest of its arguments. 9. What will be the output of the following code? "'pythondef divide(a, b):return a / bresult = divide(8, 2)print(result) "' A) '4.0'. B) '4'. C) '0'. D) 'None'. Show Answer Correct Answer: A) '4.0'. 10. What is the syntax for a function with variable-length arguments? A) Def total marks(*marks):return sum(marks). B) Def student info(**details):return details. C) Def multiply(a, b):return a * b. D) Def local example():x = 10. Show Answer Correct Answer: A) Def total marks(*marks):return sum(marks). 11. Function randint() is available under which module of python? A) Random. B) Math. C) Statistics. D) None of the above. Show Answer Correct Answer: A) Random. 12. Which of the following statements is true about calling functions in Python? A) A function must be called with parentheses, even if it has no parameters. B) A function can be called without parentheses if it has no parameters. C) A function call must always include arguments. D) A function cannot be called from within another function. Show Answer Correct Answer: A) A function must be called with parentheses, even if it has no parameters. 13. Which of the following is a correct way to document a function in Python? A) '# This is a function'. B) '/* This is a function */'. C) '"""This is a function"""'. D) '// This is a function'. Show Answer Correct Answer: C) '"""This is a function"""'. 14. In which part of memory does the system stores the parameter and local variables of function call A) Heap. B) Stack. C) Both a and b. D) None of the above. Show Answer Correct Answer: B) Stack. 15. A function definition has ..... number of parts A) 3. B) 4. C) 5. D) 6. Show Answer Correct Answer: C) 5. 16. Function header in Python contains ..... A) Function name. B) List of parameters. C) Return type. D) All the above. E) Only A & B. Show Answer Correct Answer: E) Only A & B. 17. Assertion (A):A function is a block of organized and reusable code that is used to perform a single, related action. Reason (R):Function provides better modularity by your application and a high degree of code reusability. A) Both A and R are true and R is the correct explanation for A. B) Both A and R are true and R is not correct explanation for 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 for A. 18. Which of the given argument types can be skipped from a function call? A) Positional arguments. B) Keyword arguments. C) Named arguments. D) Default arguments. Show Answer Correct Answer: D) Default arguments. 19. Which of the following keywords marks the begining of the function block? A) Func. B) Define. C) Def. D) Function. Show Answer Correct Answer: C) Def. 20. What is string interpolation? A) A method for encrypting strings. B) A technique for formatting numbers. C) String interpolation is the process of inserting variable values into a string. D) A way to concatenate strings without variables. Show Answer Correct Answer: C) String interpolation is the process of inserting variable values into a string. 21. What type of arguments in a function call require the number of formal parameters to match the number of actual parameters? A) Positional arguments. B) Keyword arguments. C) Default arguments. D) Named arguments. Show Answer Correct Answer: A) Positional arguments. 22. Every function returns a value; if a function does not explicitly return a value, then it will return ..... A) Return. B) None. C) Value. D) All. Show Answer Correct Answer: B) None. 23. In the range(start, stop, step) function, what does the 'stop' parameter indicate? A) The starting value of the number in the iterable. B) The ending value included in the iterable. C) The ending value excluded from the iterable. D) The step size for the sequence. Show Answer Correct Answer: C) The ending value excluded from the iterable. 24. A(n) ..... is a special variable that receives a piece of data when a function is called. A) Argument. B) Header. C) Module. D) Parameter. Show Answer Correct Answer: D) Parameter. 25. In Python, what is the correct way to define a function? A) Function greet():. B) Def greet():. C) Fun greet():. D) Make greet():. Show Answer Correct Answer: B) Def greet():. ← 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 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books