protected vs private python

Solutions on MaxInterview for protected vs private python by the best coders in the world

showing results for - "protected vs private python"
Ana Paula
07 Nov 2018
1Protected : 
2protected members of a class can be accessed by other members within 
3the class and are also available to their subclasses.
4Add a prefix _ (single underscore)
5
6Private : 
7The private members of a class are only accessible within the class.
8
9 In Python, a private member can be defined by using a prefix 
10  __ (double underscore).