diff --git a/client/src/pages/guide/english/python/class/index.md b/client/src/pages/guide/english/python/class/index.md index 852cc1baec..52104ac293 100644 --- a/client/src/pages/guide/english/python/class/index.md +++ b/client/src/pages/guide/english/python/class/index.md @@ -79,4 +79,24 @@ class Complex: x = Complex(3.0, -4.5) >>> x.r, x.i (3.0, -4.5) -``` \ No newline at end of file +``` + +#### Private Variables in Class: + +Every programming language which follows OOPs (Object Oriented Programming) concept has some mechanism of data hiding.In python if some variable needs to be hidden from the outside world we use the concept of private variables by using `__` before he variable name. + +for example: +``` +class Foo: + def __init__(self): + self.__privatenum = 3011 + + +Now if we try to access __privatenum outside the class we will get error: +x = Foo() +x.__privatenum # gives following error : 'Foo' object has no attribute '__privatenum' + +``` + + +