Train Sys
Train Sys
# Function to Display Trains and Schedules based on selected route (GI IN ANI NAKO
ARON MO OUTPUT RA ANG SPECIFIC NGA ROUTE NA IYA ADTUON)
def display_sched(current_station, destination_station):
routes = {
(1, 4): "A -> D | B, C | 6:00 a.m. | 4:00 p.m. | Every 3h",
(4, 1): "D -> A | C, B | 6:00 a.m. | 4:00 p.m. | Every 3h",
(1, 2): "A -> B | Direct | 10:30 a.m. | 3:30 p.m. | Every 1h",
(2, 1): "B -> A | Direct | 10:30 a.m. | 3:30 p.m. | Every 1h",
(2, 4): "B -> D | C | 12:45 p.m. | 5:00 p.m. | Every 2h",
(4, 2): "D -> B | C | 12:45 p.m. | 5:00 p.m. | Every 2h",
(1, 3): "A -> C | Direct | 11:00 a.m. | 4:00 p.m. | Every 1h30m",
(3, 1): "A -> C | Direct | 11:00 a.m. | 4 p.m. | Every 1h30m"
}
# Display the selected route (DIARI MO OUTPUT SYA NYA MAKITA SA USER KUNG ASA
IYANG STOP UG UNSA NGA TIME SAD IYAHA LAKAW)
selected_route = (current_station, destination_station)
if selected_route in routes:
print(f"\nROUTE FROM STATION {current_station} TO STATION
{destination_station}: ")
print(f"\n== {routes[selected_route]}")
else:
print("\nNo direct route available for the selected stations.")
# Main Function
def travel():
while True:
display_station()
try:
choice = int(input("\n==Select your Station (1-6): "))
except ValueError:
print("Station not found. Please input numbers only between 1 to 6")
continue
if choice == 6:
continue
if user_input == "BOOK":
display_dashboard()
try:
choice_one = int(input("\nEnter Choice (1-3): "))
except ValueError:
print("Invalid input. Please enter a number between 1 and
3.")
continue
if choice_one == 1:
print("\nTicket BOOKED successfully, Thank You!!")
break
elif choice_one == 2:
continue
elif choice_one == 3:
return