Empowering Students with AI-Powered Assessments & Intelligent Learning
Chapter Exam

Chapter 7: Python Functions — Online MCQ Test

COMPUTER SCIENCE · CLASS 12th · Tamil Nadu State Board

Practice Chapter 7: Python Functions with a free chapter-wise online MCQ test for Tamil Nadu State Board CLASS 12th COMPUTER SCIENCE. This chapter covers: Focusing on modular programming this chapter details defining and calling user functions in Python. It explains function arguments return statements variable scope recursive functi.... AI-generated questions from basic to board-exam level, with instant results and explanations.

10
Questions
20m
Time Limit
3
Attempts Left
  • 10 random questions from this chapter (mixed difficulty)
  • Questions you've seen before won't repeat until the pool resets
  • You have 20 minutes — exam auto-submits when time is up
  • Maximum 3 attempts per chapter
  • Results and explanations shown immediately after submission
Login to Start This Exam →

New here? Register free — includes 3 free chapter exams.

Chapter 7: Python Functions — Important Questions & Answers (FAQ)

Frequently asked questions from Tamil Nadu State Board CLASS 12th COMPUTER SCIENCE — Chapter 7: Python Functions, with answers and explanations. These are sample questions; the exam has its own separate question set.

What is the main advantage of using functions in Python?
  • A. They make programs more modular and reusable ✓
  • B. They remove the need for variables
  • C. They always run faster than normal code
  • D. They can only be used in built-in libraries
Answer: A. They make programs more modular and reusable
Functions help break a program into smaller, reusable parts, making the code easier to read and maintain.
Which keyword is used to define a function in Python?
  • A. func
  • B. define
  • C. def ✓
  • D. function
Answer: C. def
In Python, the keyword `def` is used to create a user-defined function.
What will the following function return? ```python def square(n): return n * n ``` If `square(5)` is called, what is the output?
  • A. 10
  • B. 25 ✓
  • C. 55
  • D. Error
Answer: B. 25
The function multiplies the number by itself, so `5 * 5 = 25`.
What is the output of the following code? ```python x = 10 def test(): x = 20 print(x) test() print(x) ```
  • A. 20 20
  • B. 10 20
  • C. 20 10 ✓
  • D. 10 10
Answer: C. 20 10
Inside `test()`, `x` is a local variable with value 20. Outside the function, the global `x` remains 10.
What is the output of the following code? ```python def demo(a, b=5): return a + b print(demo(3)) ```
  • A. 8 ✓
  • B. 15
  • C. 3
  • D. Error because `b` is not passed
Answer: A. 8
`b` has a default value of 5, so `demo(3)` becomes `3 + 5 = 8`.

Choose Your Plan & Start Practising

All plans cover every subject and chapter of your registered grade.

Free
₹0
3 exams · 1 year
Start Free →
Active
₹350
12 exams · 1 year
Get Active →
Pro
₹899
Unlimited exams · 1 year
Get Pro →

Compare all plans in detail →