[Basics of Getting Started with Python] Attribute Access and Descriptor

Attribute access

Insert picture description here
Example
Calculate the area of ​​a rectangle. When the input is a square, the length and width are equal.
Insert picture description here
Insert picture description here

Descriptor

Insert picture description here
Example: classes that convert degrees Celsius and Fahrenheit to each other
Insert picture description here

Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_36477513/article/details/112209865