1. Home
  2. Data Science
  3. Python
  4. What error occurs when assigning to a property that has no…

Added 25 Nov 2026

What error occurs when assigning to a property that has no setter in Python?

  1. TypeError
  2. ValueError
  3. NameError
  4. AttributeError Correct answer

Correct answer

D. AttributeError

6 views

MCQSEXAM

Explanation

A read-only property raises AttributeError on assignment.

Reference

Asked in: Python Interview OOP

https://docs.python.org/3/tutorial/classes.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is D? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs