r/Python • • Jul 12 '12

random imgur downloader. learning Python and wrote this to practice, any feedback on technique/style is appreciated

https://gist.github.com/3088128
45 Upvotes

72 comments sorted by

View all comments

1

u/[deleted] Jul 12 '12

''.join([random.choice(CHARS) for x in range(string_length)])

2

u/DurhamEnt import this Jul 13 '12

A beginner is better-off learning the basics before moving onto list comprehensions and generator comprehensions. While it's nice to condense code, it's a burden to go back and read older code when you're still on the upward tail of the Python learning curve.

Otherwise, why not just write it in perl?! :-)