nerdexam
Python_Institute

PCPP-32-101 · Question #10

Which sentence about the @property decorator is false?

The correct answer is C. The @property decorator marks the method whose name will be used as the name of the. The @property decorator should be defined after the method that is responsible for setting an encapsulated attribute is a false sentence. In fact, the @property decorator should be defined before the method that is used to set the attribute value. The @property decorator and…

Advanced OOP

Question

Which sentence about the @property decorator is false?

Options

  • AThe @property decorator should be defined after the method that is responsible for setting an
  • BThe @property decorator designates a method which is responsible for returning an attribute
  • CThe @property decorator marks the method whose name will be used as the name of the
  • DThe @property decorator should be defined before the methods that are responsible for setting

How the community answered

(52 responses)
  • A
    2% (1)
  • B
    4% (2)
  • C
    87% (45)
  • D
    8% (4)

Explanation

The @property decorator should be defined after the method that is responsible for setting an encapsulated attribute is a false sentence. In fact, the @property decorator should be defined before the method that is used to set the attribute value. The @property decorator and the setter and deleter methods work together to create an encapsulated attribute, which is used to provide control over the attribute's value.

Topics

#@property decorator#getter setter#encapsulation#property methods

Community Discussion

No community discussion yet for this question.

Full PCPP-32-101 Practice