title: Creating a List with 3 Conditions in Python
body: <p>The code below is a simple modification of the code that reads a page with Selenium and stores the address in a variable according to the condition of the page. (It's too long, so I've simplified some of it.)</p>
  <pre><code>a = [&quot;70&quot;, &quot;80&quot;, &quot;90&quot;, &quot;100&quot;, &quot;110&quot;]
  b = [112, 1513, 14, 505, 36]
  c = [&quot;url_1&quot;, &quot;url_2&quot;, &quot;url_3&quot;, &quot;url_4&quot;, &quot;url_5&quot;]
  
  last = []
  num = 0
  for l in a:
      if 110 == int(l):
          last.insert(0, c[num])
  
      elif 100 == int(l):
          last.append(c[num])
  
      elif 90 == int(l):
          last.append(c[num])
  
      elif 80 == int(l):
          last.append(c[num])
  
      elif 70 == int(l):
          last.append(c[num])
      num += 1
  
  print(last)
  </code></pre>
  <p>Originally, it was the idea of putting the elements of variable-a in variable-last in order of magnitude.</p>
  <p>But I found that I need to reorder the contents by the elements of list b.</p>
  <p>What I want to do is to sort the elements of variable-a in numerical order, while at the same time sorting them again in order of largest in the elements of variable-b.</p>
  <p>For example</p>
  <pre><code>a = [&quot;70&quot;, &quot;100&quot;, &quot;90&quot;, &quot;100&quot;, &quot;100&quot;]
  b = [112, 1513, 14, 505, 36]
  c = [&quot;url_1&quot;, &quot;url_2&quot;, &quot;url_3&quot;, &quot;url_4&quot;, &quot;url_5&quot;]
  </code></pre>
  <p>When classifying '100' in a above, it is also to consider the size of the numbers on the same index in b and classify them in order of size. So, again, the elements of c with the same index are put into the variable last in order. so finally</p>
  <pre><code>last = [&quot;url_2&quot;, &quot;url_4&quot;, &quot;url_5&quot;, &quot;url_3&quot;, &quot;url_1&quot;]
  </code></pre>
  <p>I want to complete a list in this order. All day long, I failed. help</p>