title: Python Matching Multiple Keys/ Unique Pairs to a Value
body: <p>What would be the fastest, most efficient way to grab and map multiple values to one value. For a use case example, say you are multiplying two numbers and you want to remember if you have multiplied those numbers before. Instead of making a giant matrix of X by Y and filling it out, it would be nice to query a Dict to see if dict[2,3] = 6 or dict[3,2] = 6. This would be especially useful for more than 2 values.</p>
  <p>I have seen an answer similar to what I'm asking here, but would this be O(n) time or O(1)?
  <a href="https://stackoverflow.com/questions/63394416/print-value-for-matching-multiple-key">print value for matching multiple key</a></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>for key in responses:
      if user_message in key:
          print(responses[key])</code></pre>
  </div>
  </div>
  </p>
  <p>Thanks!</p>