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.
2. What is the correct syntax to define a function with variable-length arguments in Python?
3. What is the scope of a variable defined inside a function?
4. Which of these is TRUE about a function that uses return?
5. What will the following code output? def multiply(x, y):return x * y; print(multiply(4, 5))
6. Which of the following is NOT a valid function parameter in Python?
7. Which of the following is a valid way to define a function with variable-length arguments?
8. ..... is a blank space in the beginning of a statement within a block.
9. Consider the line of code:Label('Go Team', 200, 100)What is the Label?
10. Which of the following is correct regarding an Argument?
11. You ..... a function to execute it.
12. What is the purpose of the main function?
13. Which type of function allows returning multiple values in Python?
14. What is the output of the following code? def sub(x, y):return x-y; print(sub(10, 5))
15. What is the correct way to call a function named 'calculate' with arguments '5' and '10'?
16. In which arguments the correct positional order is passed to a function?
17. Pick the correct one to execute the given statement successfully.if:print(x, "is a leap year")
18. Which of the following is the use of id() function in python?
19. Which of the following is not true about functions?
20. Recursion is similar to which of the following?
21. Which of the following is a correct way to define a function with two parameters?
22. What is the output of 'len('Hello')'?
23. Which of these in not a built in function?
24. Which of the following pertains to a piece of code that can take inputs to perform a specific task?
25. Which of the following is the correct way to define a function in Python that takes no parameters?