Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. def menu():
  2. ciclo=True
  3. while ciclo:
  4. opcion=int(input(("1 = Coche Nuevo !! 2 = Color !! 3 = mantenimiento !! 4 = Arrancar !! 5= Lista !! 6 = Estado !! 0 = Salir ")))
  5. if opcion==0:
  6. break
  7. elif opcion==1:
  8. entra='coche'
  9. entra=Coche()
  10. entra.cocheNuevo()
  11. elif opcion==5:
  12. break
  13. def cocheNuevo(self):
  14. ciclo = True
  15. while (ciclo):
  16. if not mLista:
  17. mLista.append('miCoche1')
  18. else:
  19. numero=(len(mLista)+1)
  20. nuevo='miCoche'+str(numero)
  21. print (nuevo)
  22. nuevo=Coche()
  23. mLista.append(nuevo)
  24. #print (mLista[:])
  25. salir= int(input("Desea Agregar otro coche? 1- <si> 2-<no>: "))
  26. if salir == 2:
  27. ciclo=False
  28. break
  29. def arrancar(self):
  30. self.enmarcha=True
  31.  
  32. if (self.enmarcha):
  33. cheq=self.chequeo()
  34.  
  35. def estado(self):
  36. if (self.__enmarcha):
  37. print ("El coche esta en marcha")
  38. else:
  39. print ("El coche esta detenido")
  40. def c_color(self,algusto):
  41. self.__color=algusto
  42. def situacion(self,nombre):
  43. if self.__enmarcha:
  44. estado_2=" En marcha"
  45. else:
  46. estado_2=" Detenido"
  47.  
  48. print ("El coche: ",nombre," tiene ", self.__ruedas," ruedas. Un ancho:",self.__anchoChazis," un largo: ",
  49. self.__largoChazis," Su color es: ",self.__color," Y su estado es: ",estado_2)
  50. def chequeo(self):
  51. print ("REALIZANDO CHEQUEO")
  52. self.gasolina="ok"
  53. self.aceite="ok"
  54. self.puertas="cerradas"
  55.  
  56. if(self.gasolina=="ok" and self.aceite=="ok"and self.puertas=="cerradas"):
  57. return True
  58. else:
  59. return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement