Проблемы с двумерным массивом - PullRequest
0 голосов
/ 28 сентября 2019

Я хочу добавить 2 значения (время и планета) в мой 2d массив.Я в основном храню заказы.

Я пытался запустить его несколько раз, только чтобы каждый раз получать ошибки различного типа.


Times_slots30 = ["8am", "9am", "10am", "11am", "12pm", "1pm","2pm", "3pm", "4pm", "5pm"]
Times_slots60 = ["8am", "9.30am", "11am", "12.30am", "2pm", "3.30pm","5pm"]

Bookings30 = [ [ ],[ ] ]

Bookings60 = [ ]

Length = int(input("The flights can either be 0)30 or 1)60 minutes long. Choose flight duration; 0 or 1: "))

if Length == 0:
    for i in range(10):
        print("Plane types: ")
        print("A)2-Seater / B)4-Seater / C)Historic")
        planetype = str(input("Choose plane type:    "))

        print("The available time slots are: ")
        print(Times_slots30)
        time = str(input("Choose flight time: "))

        print("Booked: A", planetype, "for 30 minutes, at", time)
        confirm = int(input("Enter 1 to finish. Enter 2 to cancel. Enter 3 to add more bookings: "))

        if confirm == 1:
            Bookings30.append(planetype,time)
            print(Bookings30)

        elif confirm == 2:
            exit()

        elif confirm == 3:
            Length = int(input("The flights can either be 0)30 or 1)60 minutes long. Choose flight duration; 0 or 1: "))

elif Length == 1:
    for i in range(6):
        print("Plane types: ")
        print("A)2-Seater / B)4-Seater / C)Historic")
        planetype = str(input("Choose plane type:    "))

        print("The available time slots are: ")
        print(Times_slots30)
        time = str(input("Choose flight time: "))

        print("Booked: A", planetype, "for 30 minutes, at", time)
        confirm = int(input("Enter 1 to finish. Enter 2 to cancel. Enter 3 to add more bookings: "))

        if confirm == 1:
            Bookings30.append(planetype)(time)
            print(Bookings30)

        elif confirm == 2:
            exit()

        elif confirm == 3:
            Length = int(input("The flights can either be 0)30 or 1)60 minutes long. Choose flight duration; 0 or 1: "))
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...