Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to declare private attribute in python

class Base:
	def __init__(self):
    	self.__private_attribute = 2 #two underscores before attribute declare it as private
 
PREVIOUS NEXT
Tagged: #declare #private #attribute #python
ADD COMMENT
Topic
Name
7+1 =