1. Home
  2. Data Science
  3. Python
  4. What does the @property decorator do in Python?

Added 25 Nov 2026

What does the @property decorator do in Python?

  1. Lets a method be accessed like an attribute Correct answer
  2. Makes an attribute private
  3. Makes a class abstract
  4. Creates a class variable

Correct answer

A. Lets a method be accessed like an attribute

6 views

MCQSEXAM

Explanation

@property exposes a method as a read-only attribute (with optional setter).

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 A? 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