Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- import os
- bus = np.zeros([12,4], dtype = object)
- pasajero = np.zeros([12,4], dtype = object)
- rut = np.zeros([12,4], dtype = object)
- telefono = np.zeros([12,4], dtype = object)
- costo = np.zeros([12,4], dtype = object)
- #lista pasajeros
- pasajero1=[]
- rut1=[]
- telefono1=[]
- costo1=[]
- def reservar():
- fila = int(input ("Fila>>"))
- colu = int(input ("Colu>>"))
- if (bus[fila][colu]==1):
- print ("Ocupado")
- else:
- name = input("nombre:>>")
- pasajero[fila][colu]=name
- pasajero1.append(name)
- rt = input("rut:>>")
- rut [fila][colu]=rt
- rut1.append(rt)
- tele = int(input("telefono:>>"))
- telefono [fila][colu]=tele
- telefono1.append(tele)
- bus[fila][colu]=1
- print ("Reserva exitosa")
- if (fila>8):
- costo [fila][colu]= 6800
- else:
- costo [fila][colu]= 5000
- costo1.append(costo)
- def datos_pasajeros ():
- fila = int(input ("Fila>>"))
- colu = int(input ("Colu>>"))
- for i in range(fila):
- for j in range(colu):
- if (bus[fila][colu]==1):
- print (f"Pasaje a nombre de:\t{pasajero1[i][j]}")
- print (f"Rut:\t\t\t{rut1[i][j]}")
- print (f"Telefono:\t\t{telefono1[i][j]}")
- print (f"valor de pasaje:\t{costo1[i][j]}")
- print("")
- else:
- print("Asiento disponible, sin datos para mostrar")
- def modificar():
- print ("Indique fila y columna a modificar")
- fila = int(input ("Fila>>"))
- colu = int(input ("Colu>>"))
- if (bus[fila][colu]==1):
- bus[fila][colu]=0
- print("indique la nueva fila y columna a reservar")
- reservar()
- def listar():
- for i in range(12):
- for j in range (4):
- if (bus[i][j]!=0):
- print (pasajero[i][j])
- while (1):
- print ("\t Reserva de pasajes")
- print ("1)Asientos disponibles")
- print ("2)Reservar asientos")
- print ("3)modificar asientos")
- print ("4)Datos de los pasajeros")
- print ("5)Lista de pasajeros")
- print ("6)Salir")
- opcion = input (">>")
- if (opcion == "1"):
- print (bus)
- print("presione Enter para continuar")
- input()
- os.system("cls")
- if (opcion == "2"):
- reservar()
- print("presione Enter tecla para continuar")
- input()
- os.system("cls")
- if (opcion == "3"):
- modificar()
- print("presione Enter tecla para continuar")
- input()
- os.system("cls")
- if (opcion == "4"):
- datos_pasajeros()
- print("presione Enter tecla para continuar")
- input()
- os.system("cls")
- if (opcion == "5"):
- listar()
- print("presione Enter tecla para continuar")
- input()
- os.system("cls")
- if (opcion == "6"):
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement