This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 5 Functions In Python – Quiz 6 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 5 Functions In Python Quiz 6 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. Assertion. A variable declared inside a function cannot be used outside it.Reason. A variable created inside a function has a function scope. 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. 2. What is the correct syntax to define a function with variable-length arguments in Python? A) 'def myFunction(*args):'. B) 'def myFunction(args*):'. C) 'def myFunction(*args):'. D) 'def myFunction(args*):'. Show Answer Correct Answer: A) 'def myFunction(*args):'. 3. What is the scope of a variable defined inside a function? A) Global. B) Local. C) Static. D) Dynamic. Show Answer Correct Answer: B) Local. 4. Which of these is TRUE about a function that uses return? A) It only prints the answer on the screen. B) It gives a value back to the program. C) It cannot take parameters. D) It always works without inputs. Show Answer Correct Answer: B) It gives a value back to the program. 5. What will the following code output? def multiply(x, y):return x * y; print(multiply(4, 5)) A) 45. B) 9. C) 20. D) Error. Show Answer Correct Answer: C) 20. 6. Which of the following is NOT a valid function parameter in Python? A) 'def func(x, y):'. B) 'def func(x=5):'. C) 'def func(*args):'. D) 'def func(x y):'. Show Answer Correct Answer: D) 'def func(x y):'. 7. Which of the following is a valid way to define a function with variable-length arguments? A) 'def myFunction(*args):'. B) 'def myFunction(args*):'. C) 'def myFunction(*args):'. D) 'def myFunction(args):'. Show Answer Correct Answer: A) 'def myFunction(*args):'. 8. ..... is a blank space in the beginning of a statement within a block. A) Indention. B) Space. C) Body. D) None of the above. Show Answer Correct Answer: A) Indention. 9. Consider the line of code:Label('Go Team', 200, 100)What is the Label? A) Argument. B) Parameter. C) Function name. D) None of the above. Show Answer Correct Answer: C) Function name. 10. Which of the following is correct regarding an Argument? A) A variable which we use in the function definition. B) A value we pass when we call the function. C) The order in which statements are executed. D) A keyword used to return a result from a function. Show Answer Correct Answer: B) A value we pass when we call the function. 11. You ..... a function to execute it. A) Define. B) Import. C) Call. D) Export. Show Answer Correct Answer: C) Call. 12. What is the purpose of the main function? A) To define the mainline logic of the program. B) To call other functions when needed. C) To execute the program. D) Both A and B. Show Answer Correct Answer: D) Both A and B. 13. Which type of function allows returning multiple values in Python? A) Dictionary function. B) Tuple function. C) Multi-value function. D) Single-value function. Show Answer Correct Answer: B) Tuple function. 14. What is the output of the following code? def sub(x, y):return x-y; print(sub(10, 5)) A) 5. B) 15. C) 10. D) Error. Show Answer Correct Answer: A) 5. 15. What is the correct way to call a function named 'calculate' with arguments '5' and '10'? A) 'calculate(5, 10)'. B) 'calculate[5, 10]'. C) 'calculate\{5, 10\}'. D) 'calculate<5, 10>'. Show Answer Correct Answer: A) 'calculate(5, 10)'. 16. In which arguments the correct positional order is passed to a function? A) Required. B) Keyword. C) Default. D) Variable-length. Show Answer Correct Answer: A) Required. 17. Pick the correct one to execute the given statement successfully.if:print(x, "is a leap year") A) X%2==0. B) X%4==0. C) X/4=0. D) X%4=0. Show Answer Correct Answer: B) X%4==0. 18. Which of the following is the use of id() function in python? A) Id returns the identity of the object. B) Every object doesn't have a unique id. C) All of the mentioned. D) None of the mentioned. Show Answer Correct Answer: A) Id returns the identity of the object. 19. Which of the following is not true about functions? A) They divide a large program into smaller modules. B) Provide a systematic way of problem solving. C) Make the program difficult to manage and understand. D) Helps in creating user defined libraries. Show Answer Correct Answer: C) Make the program difficult to manage and understand. 20. Recursion is similar to which of the following? A) If-else. B) Switch-case. C) Loops. D) None of the above. Show Answer Correct Answer: C) Loops. 21. Which of the following is a correct way to define a function with two parameters? A) 'def myFunc(x, y):'. B) 'def myFunc(x; y):'. C) 'def myFunc(x y):'. D) 'def myFunc(x:y):'. Show Answer Correct Answer: A) 'def myFunc(x, y):'. 22. What is the output of 'len('Hello')'? A) 4. B) 5. C) Hello. D) 6. Show Answer Correct Answer: B) 5. 23. Which of these in not a built in function? A) Int(). B) Power(). C) Len(). D) Type(). Show Answer Correct Answer: B) Power(). 24. Which of the following pertains to a piece of code that can take inputs to perform a specific task? A) Arguments. B) Functions. C) Parameters. D) Loops. Show Answer Correct Answer: B) Functions. 25. Which of the following is the correct way to define a function in Python that takes no parameters? A) 'function myFunction():'. B) 'def myFunction():'. C) 'define myFunction():'. D) 'func myFunction():'. Show Answer Correct Answer: B) 'def myFunction():'. ← 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 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