Re: "do" as a keyword

2007-12-14 Thread Tobiah
> But reading through the warts and reading about a lack of "do while > statements" I also started to ponder about the "'do something' if > 'true' else 'do this'", and pondered if perhaps this statement could > do with the including of the keyword do. I often miss what can be done in other langua

Re: "do" as a keyword

2007-12-13 Thread BJörn Lindqvist
On Dec 11, 2007 4:06 PM, Neil Cerutti <[EMAIL PROTECTED]> wrote: > > However, did you have an specific need for a do-while construct? > Perhaps we could show you the alternatives. I have wanted do-while loops in exactly one kind of algorithms, when you generate something and you have to keep tryin

Re: "do" as a keyword

2007-12-13 Thread Tommy Grav
On Wed, 12 Dec 2007 09:46:09 -0600, Chris Mellon wrote: > I agree that it's fundamental, but I'd like to mention that I've > written > many thousands of lines of Python code, from throwaway code for > demonstration to enterprisey servers and all sorts of things in > between > and I've *never*

Re: "do" as a keyword

2007-12-12 Thread Steven D'Aprano
On Wed, 12 Dec 2007 09:46:09 -0600, Chris Mellon wrote: > On Dec 11, 2007 2:19 PM, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> On Tue, 11 Dec 2007 15:06:31 +, Neil Cerutti wrote: >> >> > When I use languages that supply do-while or do-until looping >> > constructs I rarely need them. >> ..

Re: [Edu-sig] "do" as a keyword

2007-12-12 Thread michel paul
> they find the "while" logic to be unintuitive I've found that a good way to explain 'while' is to consider it as an 'if' statement that repeats. Kids grasp simple conditionals fairly easily. I would sometimes hear them talk about 'if loops' when they were actually trying to discuss conditional

Re: "do" as a keyword

2007-12-12 Thread Chris Mellon
On Dec 11, 2007 2:19 PM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 11 Dec 2007 15:06:31 +, Neil Cerutti wrote: > > > When I use languages that supply do-while or do-until looping constructs > > I rarely need them. > ... > > However, did you have an specific need for a do-while constr

Re: [Edu-sig] "do" as a keyword

2007-12-12 Thread kirby urner
> I find that when teaching beginning programmers, they usually think in > "until" terms, and not "while" terms. > If really beginning, an overview of this whole idea of control structures makes sense, such as this wikipedia article: http://en.wikipedia.org/wiki/Control_flow Then explain how Pyth

Re: "do" as a keyword

2007-12-12 Thread Antoon Pardon
On 2007-12-12, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >|| >| But loops that run at least once is a basic element of algorithms. >| Perhaps not as common as the zero or more times of the while loop, but >| still fun

Re: "do" as a keyword

2007-12-12 Thread Brian Blais
On Dec 11, 2007, at Dec 11:11:11 PM, Terry Reedy wrote: "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] || | But loops that run at least once is a basic element of algorithms. | Perhaps not as common as the zero or more times of the while loop, but | still fu

Re: "do" as a keyword

2007-12-11 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] || | But loops that run at least once is a basic element of algorithms. | Perhaps not as common as the zero or more times of the while loop, but | still fundamental. It is a shame it has to be faked using: | | while Tru

Re: "do" as a keyword

2007-12-11 Thread Steven D'Aprano
On Tue, 11 Dec 2007 15:06:31 +, Neil Cerutti wrote: > When I use languages that supply do-while or do-until looping constructs > I rarely need them. ... > However, did you have an specific need for a do-while construct? Perhaps > we could show you the alternatives. "Need" is a strong word. Af

Re: "do" as a keyword

2007-12-11 Thread Tor Erik Sønvisen
> I also started to ponder about the "'do > something' if 'true' else 'do this'", and pondered if perhaps > this statement could do with the including of the keyword do. Python has support for this in versions >= 2.5: >>> a = range(0, 5) >>> b = range(5, 8) >>> min(a) if sum(a) < sum(b) else min(

Re: "do" as a keyword

2007-12-11 Thread Neil Cerutti
On 2007-12-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > First off let me state that I really enjoy using Python. I am a > 3rd year student and have been using python for 3 months, > (thanks to trac!). I do not consider myself an experienced or > clever programmer, but I am able to get by. > >

Re: "do" as a keyword

2007-12-11 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > First off let me state that I really enjoy using Python. I am a 3rd > year student and have been using python for 3 months, (thanks to > trac!). I do not consider myself an experienced or clever programmer, > but I am able to get by. > > Something I love about Python is

"do" as a keyword

2007-12-11 Thread cokofreedom
First off let me state that I really enjoy using Python. I am a 3rd year student and have been using python for 3 months, (thanks to trac!). I do not consider myself an experienced or clever programmer, but I am able to get by. Something I love about Python is that almost everything you do can be