title: looking for more pythonic apporach
body: <p>Just wrote this function...</p>
  
  <pre><code>def nrofleadingchars(stringtotest, testchar='\t'):
      count = 0
      for c in stringtotest:
          if c == testchar:
              count = count + 1
          else:
              return count
      return count
  </code></pre>
  
  <p>However does not feel pythonic 'enough', suggestions?</p>