15 extra multiple-choice questions for Python functions (12th Standard Computer Science, Samacheer Kalvi), beyond the ones printed in the textbook — each with the correct option highlighted and a clear, worked explanation. Free to read in English and Tamil.
Q1
Which Python keyword is used to begin a function block?
- A. function
- B. defCorrect
- C. define
- D. func
Explanation. In Python, user-defined functions are defined using the 'def' keyword, followed by the function name and parentheses.
Q2
If a function's return statement has no arguments or is missing, what default object does Python return?
- A. 0
- B. False
- C. NoneCorrect
- D. Null
Explanation. When a function does not contain a return statement or contains a return statement with no arguments, it returns the 'None' object.
Q3
What type of argument is defined using an asterisk (*) in the function's definition?
- A. Required arguments
- B. Keyword arguments
- C. Default arguments
- D. Variable-length argumentsCorrect
Explanation. Python uses an asterisk symbol (*) before an argument name in the function header to define variable-length arguments, allowing any number of arguments to be passed.
Q4
Which error is raised if you try to access a local variable outside its defined function scope?
- A. ValueError
- B. TypeError
- C. NameErrorCorrect
- D. ScopeError
Explanation. A local variable only exists during the function's execution. Attempting to reference it from outside the function raises a NameError.
Q5
What is the term used when the value returned by one function is passed as an argument to another function in a nested manner?
- A. Recursion
- B. CompositionCorrect
- C. Integration
- D. Chaining
Explanation. Composition is the practice of nesting function calls so that the output of one function becomes the input argument for another.
Q6
By default, how many times will Python allow a recursive function to call itself before raising a RecursionError?
- A. 500
- B. 1000Correct
- C. 2000
- D. 3000
Explanation. Python limits the maximum recursion depth to 1000 calls by default to prevent stack overflow.
Q7
Which function of the sys module is used to modify the default limit for recursion depth in Python?
- A. sys.recursion_limit()
- B. sys.setrecursionlimit()Correct
- C. sys.limit_recursion()
- D. sys.maxrecursion()
Explanation. The sys.setrecursionlimit() function allows programmers to change the default recursion depth limit to a higher custom value.
Q8
What will be the output of print(ord('A')) in Python?
- A. 97
- B. 65Correct
- C. 'A'
- D. 66
Explanation. The built-in ord() function returns the ASCII integer value of a single character. For 'A', it is 65.
Q9
Which of the following built-in functions is the direct inverse of the ord() function?
- A. bin()
- B. chr()Correct
- C. str()
- D. id()
Explanation. The chr() function takes an ASCII integer value and returns its corresponding character, making it the inverse of the ord() function.
Q10
What keyword is used to create one-time anonymous functions in Python?
- A. anonymous
- B. def
- C. lambdaCorrect
- D. inline
Explanation. Anonymous functions are defined without a name using the 'lambda' keyword, which is why they are also called lambda functions.
Q11
What exception is raised if you try to modify a global variable inside a function without declaring it as global first?
- A. NameError
- B. UnboundLocalErrorCorrect
- C. ValueError
- D. GlobalError
Explanation. Modifying a global variable inside a local scope without using the 'global' keyword first causes an UnboundLocalError in Python.
Q12
What is returned by the format(25, 'o') function in Python?
- A. 31Correct
- B. 25
- C. 0o31
- D. 11001
Explanation. Passing the 'o' formatting specifier to the format() function converts the decimal number 25 into its octal representation, which is 31.
Q13
What is the output of the mathematical function math.floor(-26.7) after importing the math module?
- A. -26
- B. -27Correct
- C. -26.0
- D. 26
Explanation. The math.floor() function returns the largest integer less than or equal to the input. For -26.7, the largest integer less than or equal to it is -27.
Q14
What is the output of math.ceil(-26.7) after importing the math module?
- A. -26Correct
- B. -27
- C. -26.0
- D. 27
Explanation. The math.ceil() function returns the smallest integer greater than or equal to the input. For -26.7, this is -26.
Q15
Which argument type in Python matches values to their parameter names, allowing them to be passed in a different order than defined?
- A. Required arguments
- B. Keyword argumentsCorrect
- C. Default arguments
- D. Variable-length arguments
Explanation. Keyword arguments match values based on parameter names rather than positional order, enabling callers to specify arguments out of order.
About these Python functions questions
These are the Additional multiple-choice questions for Python functions from the Tamil Nadu State Board (Samacheer Kalvi) 12th Standard Computer Science syllabus. Each question shows the correct option and an original, step-by-step explanation so you understand the method, not just the answer. Use the answer key above to jump to any question, then take the practice test to check yourself under exam-like conditions.
Frequently asked questions
How many MCQs are there in Python functions?
This chapter has 15 book-back multiple-choice questions, each with the correct answer and a step-by-step explanation.
Are these 12th Standard Computer Science MCQs free to practise online?
Yes. Every question, answer and explanation here is free, and you can also take them as a timed practice test.
Where can I find the Python functions book-back answers?
The correct option for each question is highlighted on this page with a worked explanation, plus a quick answer-key summary at the top.