TypeError: 'list' object is not callable: why?
Question: 
    from difflib import get_close_matches
    
    order_output = {
        "initiate ion drive" : "Initiating the ion drive.",
        "run" : "Running",
        "eat" : "Eating",
        "enter coords to" : "Settings coords to:"
    }
    
    
    orders_list = ["initiate ion drive", "eat", "run", "enter coords to"]
    
    def ord_input():
        order = input()
        order1 = get_close_matches(order, orders_list)
        order2 = ''.join(map(order1, order_output))
        if order:               ^#the problem
            print(order_output[order1])
        else:
            print("Don't know this order.")
    
    ord_input()
    

This is the error:

    
    
    Traceback (most recent call last):
      File "C:/Python34/order.py", line 16, in <module>
        ord_input()
      File "C:/Python34/order.py", line 11, in ord_input
        order2 = ''.join(map(order1, order_output))
    TypeError: 'list' object is not callable
    

I want to convert that specific list string to a regular string.

How can I do that?


Answer: `difflib.get_close_matches` returns a list. The `map` builtin takes a
_function_ as its first argument, and applies it to each element of the
iterable that is the second argument. So you're trying to call a list as a
function, which is a `TypeError`. A list is not callable.

If the goal is to index the `order_output` dictionary, just do so directly.

    
    
    order2 = order_output[order1]
    

