Advertisement
FernandoWarBr

classe_carro

Aug 12th, 2021
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. class Carro:
  2. def __init__(self, cor, marca, ligado=False):
  3. self.cor = cor
  4. self.marca = marca
  5. self.ligado = ligado
  6. def carro_ligado(self):
  7. print('Ligado')
  8. self.ligado = True
  9.  
  10. def carro_desligado(self):
  11. print('Desligado')
  12. self.ligado = False
  13.  
  14. def ligar_carro(self):
  15. from time import sleep
  16. print('Ligando o carro...')
  17. sleep(4)
  18.  
  19. def desligar_carro(self):
  20. from time import sleep
  21. sleep(1)
  22. print('Desligando o carro...')
  23. sleep(4)
  24.  
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement