We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 026f0a9 commit a6600bfCopy full SHA for a6600bf
1 file changed
oo/carro.py
@@ -35,7 +35,7 @@
35
>>> motor.velocidade
36
1
37
>>> motor.frear()
38
- >>> motor.velocidad
+ >>> motor.velocidade
39
0
40
>>> # Testando Direção
41
>>> direcao = Direcao()
@@ -90,6 +90,15 @@
90
>>> 'Oeste'
91
"""
92
93
+NORTE = 'Norte'
94
+SUL = 'Sul'
95
+LESTE = 'Leste'
96
+OESTE = 'Oeste'
97
+
98
99
+class Direcao:
100
+ def __init__(self):
101
+ self.valor = NORTE
102
class Motor:
103
def __init__(self):
104
self.velocidade = 0
@@ -99,3 +108,5 @@ def acelerar(self):
108
109
def frear(self):
110
self.velocidade -= 2
111
+ self.velocidade = max(0, self.velocidade)
112
0 commit comments