title: How to check if list contains consecutive numbers Python
body: <p>I have below list:</p>
  <pre><code>l = [1, 2, 3, 4, 10, 11, 12]
  </code></pre>
  <p>By looking at the above list, we can say it's not consecutive. In order to find that using python, we can use below line of code:</p>
  <pre><code>print(sorted(l) == list(range(min(l), max(l)+1)))
  # Output: False
  </code></pre>
  <p>This gives output False because <code>5, 6, 7, 8, 9</code> are missing. I want to further extend this functionality to check how many integers are missing. Also to note, no duplicates are allowed in the list. For ex:</p>
  <pre><code>l = [1, 2, 3, 4, 10, 11, 12, 14]
  </code></pre>
  <p>output of above list should be <code>[5, 1]</code> because <code>5</code> integers are missing between <code>4</code> and <code>10</code> and <code>1</code> is missing between <code>12</code> and <code>14</code></p>