Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- class vehiculo():
- matricula = ["KHV-608", "JFI-433", "FFG-432", "FDG-553", "SDJ-434", "KIS-432", "SDF-433"]
- chevrolet = [50000, 100000, 150000]
- alquilado = False
- devolver = False
- bool = "True"
- #Constructor
- def skere(self, camiones, turismo):
- self.camiones = camiones
- self.turismo = turismo
- #Metodos
- def alquilar(self):
- self.alquilado = True
- return alquilado
- def devolver(self):
- self.devolver = True
- return devolver
- def imprimirmatricula():
- aleatorio1 = random.choice(vehiculo.matricula)
- print(aleatorio1)
- def carrosturismo():
- aleatorio2 = random.choice(vehiculo.chevrolet)
- print(aleatorio2)
- def turismos(self):
- self.PrecioKm = PrecioKm
- self.kmAlquiler = kmAlquiler
- def camiones(self):
- self.precioDia = precioDia
- self.diaAlquiler = diaAlquiler
- while(True):
- print("-----MENU-----\n"+
- "Que vehiculo desea?\n"+
- "1. Turismo \n"+
- "2. Camiones\n")
- num = input("Ingrese la Opcion\n")
- if num == "1":
- print("El precio del km es de: 100 \n")
- x = int(input("Cuantos km va a recorrer?\n"))
- turismos.PrecioKm = 100
- turismos.kmAlquiler = x
- x = x*turismos.PrecioKm
- print("Su vehiculo es:")
- imprimirmatricula()
- print("Su kilometraje del vehiculo es:")
- c = carrosturismo()
- print("Su viaje va a tener un precio de: ")
- print(x)
- break
- elif num == "2":
- print("El precio del dia es de: 200 \n")
- z = int(input("Cuantos dias va a alquilarlo?\n"))
- camiones.precioDia = 200
- camiones.diaAlquiler = z
- z = z*camiones.precioDia
- print("Su vehiculo es:")
- imprimirmatricula()
- print("Su viaje va a tener un precio de: ")
- print(z)
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement