Advertisement
mfx28

Untitled

Feb 18th, 2020
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. def tranferir(self):
  2. transf = str(input('A quem pretende transferir a guita: '))
  3. if transf == v2.nome:
  4. valor = int(input('Valor a transferir: '))
  5. v2.saldo = int(v2.saldo + valor)
  6. v1.saldo = int(v1.saldo - valor)
  7. print('O v2 ficou com ',v2.saldo,' dinheiros')
  8. print('O v1 ficou com ',v1.saldo,' dinheiros')
  9. elif transf == v1.nome:
  10. valor = int(input('Valor a transferir: '))
  11. v1.saldo = int(v1.saldo + valor)
  12. v2.saldo = int(v2.saldo - valor)
  13. print('O v2 ficou com ',v1.saldo,' dinheiros')
  14. print('O v1 ficou com ',v2.saldo,' dinheiros')
  15. else:
  16. print('Nome incorreto')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement