Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! user/bin/env/ python
- # coding: UTF-8
- #class https://pastebin.com/aT8ktqCf
- import carro
- #help(carro.Carro)
- uno_vermelho = carro.Carro("vermelho",4,"Flex", 1.0) #var uno_vermelho chma classe carro definino AS CARACTERISTICAS DO CARRO
- uno_vermelho.ligar()#metodo ligar
- uno_vermelho.abastecer(50)#metodo abastecer
- uno_vermelho.abastecer(10)
- uno_vermelho.acelerar(0)#metodo acelerar
- print(f"A quantidade de combustivel é: {uno_vermelho.qtd_combustivel}")
- del uno_vermelho
- uno_preto = carro.Carro("preto",2,"Flex", 1.4) # var chma class Carro e define caracterista do carro
- uno_preto.desligar()
- uno_preto.acelerar(20)
- uno_preto.ligar()
- uno_preto.abastecer(20)
- uno_preto.acelerar(20)
- print(f"O carro foi acelerado em: {uno_preto.velocidade}")
- print(f"A quantidade de conbustivel do uno preto é: {uno_preto.qtd_combustivel}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement