Am I programming in Python mode?

Michael Hudson mwh21 at
Wed Feb 2 10:45:30 EST 2000

Mordy Ovits <movits at> writes:

> for i in range(0, n):
>    string.append(random.choice(string.letters))

I thought of that, but string.lowercase on my system contains lots of
accented characters, and I thought what I posted was closer in spirit
to the original effort. It also depends if you count é (e-acute) and e
(plain e) as different in this sense too - because if you don't then
the resulting string will contain too many of some letters, vowels in
particular - there are 10 different sorts of e in my string.letters -
and allowing for that is/was more than it's worth farting about with
for one USENET post.

PS: Your code has a stereotypical Python gotcha in it...

More information about the Python-list mailing list