title: Getting Floor Division and Remainder at same time in 2 separate variables
body: <p>Is there a python built-in (or just optimized) function to get the floor division and remainder at the same time in two separate variables?</p>
  
  <p><strong>Example:</strong></p>
  
  <pre><code>a, b = 10 divided by 4
  </code></pre>
  
  <p><strong>Desired results:</strong></p>
  
  <pre><code>a = 2
  b = 2
  </code></pre>
  
  <p><em>I need this to be an optimized solution.</em></p>
  
  <p><strong>Performance results:</strong></p>
  
  <p>First piece of code:</p>
  
  <pre><code>for i in range(10000000):
      a, b = divmod(i, 5)
  took 3.99 seconds to run
  </code></pre>
  
  <p>Second piece of code:</p>
  
  <pre><code>for i in range(10000000):
      a = i // 5
      b = i % 5
  took 2.56 seconds to run
  </code></pre>
  
  <p><strong>Remarks:</strong></p>
  
  <p>Read @casevh answer for a more detailed explanation.</p>
  
  <p>tldr: divmod() works better if numbers are big.</p>