do/while structure needed

John Salerno johnjsal at
Sun May 14 20:33:20 CEST 2006

George Sakkis wrote:

> while True:
>     random.shuffle(letters)
>     trans_letters = ''.join(letters)[:len(original_set)]
>     if some_compatison(original_set,trans_letters):
>         trans_table = string.maketrans(original_set, trans_letters)
>         break

Thanks, that looks pretty good. Although I have to say, a do/while 
structure is the much more obvious way. I wonder why it hasn't been 
added to the language.

More information about the Python-list mailing list