title: Building a function to count leading zeros in a string with no success
body: <p>This is what I came up with:</p>
  <pre><code>def leading_zeros_counter(x: str):
      zeros = 0
      for i in x:
          if i == str(0):
              zeros += 1
          else:
              return int(zeros)
  </code></pre>
  <p>It seems to work on all strings unless the string contains all zeros (e.g. '0000' does not return '4'). Can anyone explain why and how to fix this?</p>