# Modificadores de Acesso
class ContaBancaria:
def __init__(self, saldo):
self.__saldo = saldo #private
def depositar(self, valor):
if valor > 0:
self.__saldo += valor
def ver_saldo(self):
return self.__saldo
conta = ContaBancaria(100)
conta.depositar(50)
print("Saldo atual:", conta.ver_saldo())
To embed this project on your website, copy the following code and paste it into your website's HTML: