title: C++ sort code to python sorted
body: <p>I am trying to convert below C++ code to python expecially the sorting logic using sorted function but how can I pass two values in key parameter of sorted function</p>
  
  <pre><code>//vector&lt;string&gt; str contains some values
  sort(str.begin(), str.end(), compareNum);
  
  bool compareNum(string a, string b) {
     return a + b &gt; b + a;
  }
  </code></pre>
  
  <p>How to convert above code using sorted function in python</p>