Рет қаралды 53,174
This is how you should be making getters & setters in Python. It's simple and doesn't require any change to existing variable names. In the example I changed "_name" to "fruit_name", but you don't have to do that, you can easily just call it "name".
▶ Become job-ready with Python:
www.indently.io
▶ Follow me on Instagram:
/ indentlyreels