title: Using a list as an index for another list python
body: <p>I am trying to create an online shopping cart system in python to understand list better but have come across some struggles.</p>
  <p>I am having difficulties with displaying information using a list. I have already created a list where the person writes in the product the code into an empty list as shown below.</p>
  <pre><code>else:
      code_input.append(i)
      quan_input.append(s)
  code_inputed.append(code_input)
  quan_inputed.append(quan_input)
  </code></pre>
  <p>I want to use the list with the product codes to find the correlating name and price by using trying to use the code_input list as an index to find the items in the other list.</p>
  <p>I have written the simple code to try to find if it works but it comes up with TypeError: list indices must be integers or slices, not list</p>
  <p>The code</p>
  <pre><code>def display():
      index = code_inputed
      for i in code_inputed: # and index in range(len(productList)):
          print(index)
          print(productList[index], quan_inputed[index])
  </code></pre>
  <p>Any help would be greatly appreciated and I'm sorry if none of this makes any sense I am only new.</p>
  <p>Thank you</p>