>     return chr( random.randrange(0, 26) + (97 if random.randrange(0,
> 100) > 50 else 65)

> or
>
>     return chr( random.randrange(0, 26) + [26,97][random.randrange(0,
> 100) > 50]

Ah, thanks, these are the syntax examples I was looking for.

> but what's wrong with you original code?

I come from a functional programming school of thought, where you
avoid local variable declarations if at all possible.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to