Advertisement
Fhernd

encapsular_miembros.py

Dec 7th, 2018
1,728
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. class Clase:
  2.     def __init__(self):
  3.         self._interno = 0   # Miembro interno
  4.         self.publico = 1    # Miembro público
  5.        
  6.     def _metodo_interno(self):
  7.         '''
  8.        Método interno
  9.        '''
  10.         pass
  11.    
  12.     def metodo_publico(self):
  13.         '''
  14.        Método público
  15.        '''
  16.         pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement