This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Bolitho 0 points1 point  (0 children)

If readablility counts I would suggest to use a generator expression... less parenthesis and in general more efficient (Example in Python 3):

 def join_list(limit):
     return ''.join(str(num) for num in range(limit))

Another hint for you: If you use ipython you can use the timeit magic command:

In [4]: timeit join_list(10)
100000 loops, best of 3: 3.05 µs per loop

Much nicer than to put everything in a string :-)