mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-09-24 23:01:18 +08:00
fix(curriculum): Add backticks to @property (#64561)
This commit is contained in:
+2
-2
@@ -21,9 +21,9 @@ When you use a method, you always have to call it with parentheses. But with a p
|
||||
|
||||
For example, you might want to calculate a value or check that a new value is valid before saving it. Instead of calling a method for that, you can use an attribute-like way to do that.
|
||||
|
||||
To create a property, you define a method and place the @property decorator above it. This tells Python to treat the method as a property.
|
||||
To create a property, you define a method and place the `@property` decorator above it. This tells Python to treat the method as a property.
|
||||
|
||||
That takes us to getters. Here's how to create one with the @property decorator:
|
||||
That takes us to getters. Here's how to create one with the `@property` decorator:
|
||||
|
||||
```py
|
||||
class Circle:
|
||||
|
||||
Reference in New Issue
Block a user