Python Idiom Question

phil hunt philh at comuno.freeserve.co.uk
Wed Jul 11 02:00:59 CEST 2001


On Tue, 10 Jul 2001 09:33:34 -0700, Chris Barker <chrishbarker at home.net> wrote:
>Steve Holden wrote:
>
>> > The approved idiom is
>> while 1:
>>     x = raw_input()
>>     if not x:
>>         break
>>     DoSomethingInteresting()
>
>This is the approved idiom, but I never use it. I always use:
>
>x = raw_input()
>while x:
>    x = raw_input()
>    DoSomethingInteresting()
>    x = raw_input()

Do you often find you programs don't work? :-)

-- 
## Philip Hunt ## philh at comuno.freeserve.co.uk ##







More information about the Python-list mailing list