Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def menu():
- ciclo=True
- while ciclo:
- opcion=int(input(("1 = Coche Nuevo !! 2 = Color !! 3 = mantenimiento !! 4 = Arrancar !! 5= Lista !! 6 = Estado !! 0 = Salir ")))
- if opcion==0:
- break
- elif opcion==1:
- entra='coche'
- entra=Coche()
- entra.cocheNuevo()
- elif opcion==5:
- break
- def cocheNuevo(self):
- ciclo = True
- while (ciclo):
- if not mLista:
- mLista.append('miCoche1')
- else:
- numero=(len(mLista)+1)
- nuevo='miCoche'+str(numero)
- print (nuevo)
- nuevo=Coche()
- mLista.append(nuevo)
- #print (mLista[:])
- salir= int(input("Desea Agregar otro coche? 1- <si> 2-<no>: "))
- if salir == 2:
- ciclo=False
- break
- def arrancar(self):
- self.enmarcha=True
- if (self.enmarcha):
- cheq=self.chequeo()
- def estado(self):
- if (self.__enmarcha):
- print ("El coche esta en marcha")
- else:
- print ("El coche esta detenido")
- def c_color(self,algusto):
- self.__color=algusto
- def situacion(self,nombre):
- if self.__enmarcha:
- estado_2=" En marcha"
- else:
- estado_2=" Detenido"
- print ("El coche: ",nombre," tiene ", self.__ruedas," ruedas. Un ancho:",self.__anchoChazis," un largo: ",
- self.__largoChazis," Su color es: ",self.__color," Y su estado es: ",estado_2)
- def chequeo(self):
- print ("REALIZANDO CHEQUEO")
- self.gasolina="ok"
- self.aceite="ok"
- self.puertas="cerradas"
- if(self.gasolina=="ok" and self.aceite=="ok"and self.puertas=="cerradas"):
- return True
- else:
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement