Python – Find Property Attribute – property() Function with Examples

property() function is used to find the a returns a property attribute in Python for the given input.

property() function is a part of Python Built-in Functions.

Syntax of property() Function

The syntax of property() function in Python is:

property(fget=None, fset=None, fdel=None, doc=None)

 

Parameters of property() Function in Python

x – Where x is any valid . This parameter is required.

 

Compatibility

property() function is available and compatible with both Python 2.x and 3.x.

 

Return Value of property() Function in Python

property() function returns a returns a property attribute for the given input.

 

Python property() Function Example 1

Example CODE

Output:

 

Python property() Function Example 2

Example CODE

Output: