Trying to print info from dictionaries in specific order and format

I am writing a program that functions like a bus ticket booking system. One of the features is that you can check the order history for customers. I am trying to figure out how to code so that the order history can be displayed like:

Destinations                  Number of Tickets
Place 1                                      13
Place 2                                       4
Place 3                                       8

This is how I have my customer data stored:

customers_tickets = {'Milla':[1],
                     'Theruni':[1],
                     'Anna':[4],
                     'Emily':[4,2]}
customers_destinations = {'Milla':['Sydney'],
                          'Theruni':['Perth'],
                          'Anna':['Perth'],
                          'Emily':['Perth','Darwin']}

When someone books tickets, the number of tickets they book goes into customers_tickets and the places they are booking for goes into customers_destinations. This is how I am asking people for the customer history they want to view:

print("Please enter the customer name to check order history:n")
customer_history = input()

I am having trouble writing code that can print out this data in the way that I want. For instance, if you want to view Emily’s order history, I want it to look like this:

Destinations                  Number of Tickets
Perth                                         4
Darwin                                        2

I’ve tried a few ways, like

print(customers_destinations[customer_history],customers_tickets[customer_history])

But that comes out as:

['Perth', 'Darwin'] [4, 2]

And doing

print(customers_destinations[customer_history[0]],customers_tickets[customer_history[0]])

gives this error:

print(customers_destinations[customer_history[0]],customers_tickets[customer_history[0]])
KeyError: 'E'

Sorry if I’m not explaining this properly or if the answer is obvious. This is my first coding assessment and I’m still getting used to things 🙂

Answer

zip the values together

x=input()
for i,j in zip(customers_tickets[x],customers_destinations[x]):
   print(j,i)

Output:

Emily
Perth 4
Darwin 2

And here it is in a presentable mode:

x=input()
try:
   print("Destinations                  Number of Tickets")
   for i,j in zip(customers_tickets[x],customers_destinations[x]):
      print(f'{i:<29} {j}')
except KeyError:
   print(f"No order found for {x}")

Output:

#=== Test 1

Emily
Destinations                  Number of Tickets
4                             Perth
2                             Darwin

#==== Test 2

Jon
Destinations                  Number of Tickets
No order found for Jon