r/PythonLearning • • 19d ago

Get and setter in pyhton

I'm learning Python, and this part has left me a little confused, because in other languages the way it's used is different; in Python you use @property, I'd like to understand how this really works in a simplified way, so I can truly grasp it and not just memorize it. If you could help me, I'm still new to programming.

2 Upvotes

12 comments sorted by

View all comments

2

u/ninhaomah 19d ago

Pls post the code that you are confused with.

Also the comparison with the other language also.

Pls don't leave people guessing.

2

u/pedrinjose 19d ago

And I apologize if the post wasn't very clear.

1

u/ninhaomah 19d ago

Ok so the codes ?

1

u/pedrinjose 19d ago

As I said, it's not a specific code; I want to know in general.

0

u/ninhaomah 19d ago

An example doesn't mean it only applies to it and no others.

If I were to ask you what is true in while true and you replied its a boolean value , true and false , for the program to decide whether to continue or not or whether something is true or false , it applies to all usage right ?

0

u/pedrinjose 19d ago

The comparison with other languages that I mean refers to languages that do not adopt the same method as Python, and there isn't a specific program I am confused about—I just want to understand getters and setters in Python, which left me confused because they are different from the rest