Most Pythonic (and effecient way) to do string concatenation


/ Published in: Python
Save to your folder(s)

Performance can be seen in link. This code, however, uses generator expression instead of list comprehension.


Copy this code and paste it in your HTML
  1. ''.join( num for num in xrange(100000) )

URL: http://www.skymind.com/~ocrow/python_string/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.