Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cities = ["paryz", "londyn", "dabrowa gornicza"]
- flight_classes = ["ekonomiczna", "biznes", "pierwsza klas"]
- options = {
- 'bagaz': {
- 'name': "BAGAŻ",
- 'price': 100
- },
- 'ubezpiecznie': {
- 'name': "UBEZPIECZENIE",
- 'price': 60
- },
- 'SAMOCHOD': {
- 'name': "WYNAJEM SAMOCHODU",
- 'price': 200
- }
- }
- city = ""
- flight_class = ""
- option = ""
- while True:
- for index in range(len(cities)):
- print(f"{index}. {cities[index]}")
- city_index = int(input(f"Podaj miasto (0-{len(cities)-1}):"))
- if city_index not in range(0, len(cities)):
- print("Podales miasto, ktorego nie ma na liscie.")
- continue
- city = cities[city_index]
- for index in range(len(flight_classes)):
- print(f"{index}. {index[index]}")
- flight_class_index = int(input(f"Podaj klasę przelotu (0-{len(flight_classes)-1}):"))
- if flight_class_index not in range(0, len(flight_classes)):
- print("Podałes klase, której nie ma na liście.")
- continue
- flight_class = flight_classes[flight_class_index]
- print()
- for klucz, opcja in options.items():
- print(f"{opcja}")
- option = input("Podaj opcje przelotu, lub naciśnij enter by pominąć:")
- if city and flight_class:
- print(f"{city} - {flight_class} " + option if option else " bez dodatkowych opcji")
- break
- # pastebin.com/q9njFV5H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement