Don't grow strings by concatenation.  Use ''.join() instead.