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

Chapter 10: Python Classes and Objects — Online MCQ Test

COMPUTER SCIENCE · CLASS 12th · Tamil Nadu State Board

Practice Chapter 10: Python Classes and Objects with a free chapter-wise online MCQ test for Tamil Nadu State Board CLASS 12th COMPUTER SCIENCE. This chapter covers: An introduction to object-oriented programming concepts in Python. It covers class definitions object instantiation class constructors destructor methods private and public data me.... 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 10: Python Classes and Objects — Important Questions & Answers (FAQ)

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

What is the correct syntax to define a class in Python?
  • A. class ClassName: ✓
  • B. def ClassName():
  • C. create ClassName:
  • D. new ClassName()
Answer: A. class ClassName:
In Python, a class is defined using the keyword `class` followed by the class name and a colon.
Which special method is automatically called when an object is created from a class?
  • A. __del__()
  • B. __init__() ✓
  • C. __str__()
  • D. __main__()
Answer: B. __init__()
The `__init__()` method is the constructor and is called automatically when an object is created.
What will be the output of the following code? class Test: def __init__(self): print('Hello') obj = Test()
  • A. Test
  • B. Hello ✓
  • C. No output
  • D. Error
Answer: B. Hello
When `obj = Test()` is executed, the constructor `__init__()` runs and prints `Hello`.
What will be the output of the following code? class Box: def __init__(self, x): self.x = x b1 = Box(10) print(b1.x)
  • A. x
  • B. 10 ✓
  • C. Box(10)
  • D. Error
Answer: B. 10
The constructor stores the value `10` in `self.x`, so `b1.x` prints `10`.
Which statement about name mangling in Python is most accurate?
  • A. A variable named `__x` becomes completely inaccessible in all situations
  • B. A variable named `__x` is internally renamed to help avoid direct access from outside the class ✓
  • C. A variable named `_x` is treated as a public variable
  • D. Name mangling is used only for function names, not variables
Answer: B. A variable named `__x` is internally renamed to help avoid direct access from outside the class
Python changes the name of double-underscore attributes internally to reduce accidental access from outside the class.

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 →