walterbyrd wrote:
> The strings start with whitespace, and have a '*' or an alphanumeric
> character. I need to know how many whitespace characters exist at the
> beginning of the string.
> 

Hi,

I am new to python and just really learning but this is what I came up 
with.

#!/usr/bin/env python

def main():
     s = "      abc def ghi"
     count = 0

     for i in s:
         if i == ' ':
             count += 1
         else:
             break

     print count

if __name__ == '__main__':
     main()

-- 
Kind Regards,
Anthony Irwin

http://www.irwinresources.com
http://www.makehomebusiness.com
email: anthony at above domains, - www.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to