/ Published in: Python
URL: http://www.skymind.com/~ocrow/python_string/
Performance can be seen in link. This code, however, uses generator expression instead of list comprehension.
Expand |
Embed | Plain Text
''.join( num for num in xrange(100000) )
Comments
Subscribe to comments
You need to login to post a comment.

TypeError: sequence item 0: expected string, int found
''.join( str(num) for num in xrange(100000) )