Nov-01-2023, 11:50 PM
(This post was last modified: Nov-02-2023, 07:31 AM by Gribouillis.)
Hi everyone!
Tutorialspoint has a Python Tutorial but I think I found an error there.
This section:
https://www.tutorialspoint.com/python/python_vs_cpp.htm
Says this:
"C++ supports the concept of data encapsulation as the visibility of the variables can be defined as public, private and protected.
Python doesn't have the provision of defining the visibility. ..."
Python can define visibility for methods:
Tutorialspoint has a Python Tutorial but I think I found an error there.
This section:
https://www.tutorialspoint.com/python/python_vs_cpp.htm
Says this:
"C++ supports the concept of data encapsulation as the visibility of the variables can be defined as public, private and protected.
Python doesn't have the provision of defining the visibility. ..."
Python can define visibility for methods:
def public_method() def _protected_method() def __private_method()As well as visibility for attributes:
self.public_attribute self._protected_attribute self.__private_attributeCorrect?
Gribouillis write Nov-02-2023, 07:31 AM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.