title: when use negative number to slice a string in Python, 0 is disabled?
body: <p>let's say I have a string:</p>
  
  <pre><code>&gt;&gt;&gt;a = 'akwkwas'
  &gt;&gt;&gt;
  &gt;&gt;&gt;a[-3:]
  'was'
  &gt;&gt;&gt;a[-3:None]
  'was'
  &gt;&gt;&gt;a[-3:0]
  ''
  </code></pre>
  
  <p>why can't I use <code>0</code> as the end of the slice?</p>
  
  <p>this is from docs:</p>
  
  <blockquote>
    <p>One way to remember how slices work is to think of the indices as pointing between characters, with the left edge of the first character numbered 0. Then the right edge of the last character of a string of n characters has index n, for example:</p>
  </blockquote>
  
  <pre><code> +---+---+---+---+---+---+
   | P | y | t | h | o | n |
   +---+---+---+---+---+---+
   0   1   2   3   4   5   6
  -6  -5  -4  -3  -2  -1
  </code></pre>
  
  <blockquote>
    <p>The first row of numbers gives the position of the indices 0...6 in the string; the second row gives the corresponding negative indices. The slice from i to j consists of all characters between the edges labeled i and j, respectively.</p>
  </blockquote>
  
  <p>so when we use negative indices in loop , we should check the end's value, beacuse the end <code>0</code> in negative indices does not exist, such as when we split a string to a money-like string:</p>
  
  <pre><code>&gt;&gt;&gt;a = '12349878334'
  &gt;&gt;&gt;print(','.join([a[-i-3:-i if i else None] for i in range(0, len(a), 3)][::-1])) 
  &gt;&gt;&gt;12,349,878,334
  </code></pre>