title: How to use a dictionary to append values to a list?
body: <p>Trying to solve a leetcode problem right now and think I have an idea for a solution but need some help. I am given 2 lists: 1 is a list of values, and the other is the index value where I should place such values. Such as below:</p>
  <pre><code>nums = [1, 5, 3]
  index = [0, 1, 2]
  </code></pre>
  <p>So, I would have to append number 1 at index 0, 5 at index 1, etc.</p>
  <p>I have solved the problem with simple while loop but now I want to solve the problem with a dictionary, so I have made this so far:</p>
  <pre><code> list2 = []
  
   ans = dict(zip(nums, index))
          
   list2.insert(someindex, somenumber)
  </code></pre>
  <p>My question is how I can access the data in the dictionary to finish my insert command. how can I replace the code at 'someindex' and 'somenumber' to represent the index and corresponding value stored in my dictionary? Is this possible?
  Thanks for the help</p>