Re: do/while structure needed

2006-05-16 Thread Edward Elliott
Dennis Lee Bieber wrote: > Would you put the condition at the top of the loop -- and confuse > those people who believe the exit condition should appear at the point > the exit activates? Confusion is not the issue. You can put the condition smack dab in the middle of the loop, as long as the lo

Re: do/while structure needed

2006-05-16 Thread John Salerno
Dennis Lee Bieber wrote: > And what syntax would you propose? I guess something like: do: stuff goes here and here and here while (condition) The absence of a colon after the while statement can be the signal that it isn't a regular while statement with a following bloc

Re: do/while structure needed

2006-05-16 Thread Antoon Pardon
Op 2006-05-15, Terry Reedy schreef <[EMAIL PROTECTED]>: > > "John Salerno" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> 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 lang

Re: do/while structure needed

2006-05-15 Thread John Salerno
Terry Reedy wrote: > "John Salerno" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> 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. > > Been suggested many times, b

Re: do/while structure needed

2006-05-15 Thread Terry Reedy
"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > 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. Been suggested many times, been considered, and rejected.

Re: do/while structure needed

2006-05-14 Thread John Salerno
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. A

Re: do/while structure needed

2006-05-14 Thread Paul McGuire
"Ten" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sunday 14 May 2006 06:17, John Salerno wrote: > > 1 random.shuffle(letters) > > 2 trans_letters = ''.join(letters)[:len(original_set)] > > 3 trans_table = string.maketrans(original_set, trans_letters) > > > > So what I'd like t

Re: do/while structure needed

2006-05-14 Thread Ten
On Sunday 14 May 2006 06:17, John Salerno wrote: > 1 random.shuffle(letters) > 2 trans_letters = ''.join(letters)[:len(original_set)] > 3 trans_table = string.maketrans(original_set, trans_letters) > > So what I'd like to do is have lines 1 and 2 run once, then I want to do > some comparison betwee

Re: do/while structure needed

2006-05-13 Thread George Sakkis
John Salerno wrote: > 1 random.shuffle(letters) > 2 trans_letters = ''.join(letters)[:len(original_set)] > 3 trans_table = string.maketrans(original_set, trans_letters) > > So what I'd like to do is have lines 1 and 2 run once, then I want to do > some comparison between original_set and trans_let

do/while structure needed

2006-05-13 Thread John Salerno
1 random.shuffle(letters) 2 trans_letters = ''.join(letters)[:len(original_set)] 3 trans_table = string.maketrans(original_set, trans_letters) So what I'd like to do is have lines 1 and 2 run once, then I want to do some comparison between original_set and trans_letters before running line 3. If