fork download
  1. class Bola:
  2.  
  3. def __init__(self, cor, circunferencia, material):
  4. self.__cor = cor
  5. self.__circunferencia = circunferencia
  6. self.__material = material
  7. @property
  8. def cor(self):
  9. return self.__cor
  10. @cor.setter
  11. def cor(self, cor):
  12. self.__cor = cor
  13.  
  14.  
  15.  
  16. b = Bola('azul', 15, 'plástico')
  17. print(b.cor)
Success #stdin #stdout 0.02s 9104KB
stdin
Standard input is empty
stdout
azul