> 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
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
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*
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.
>> ..
> 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
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
> 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
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
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
"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
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
> 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(
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.
>
>
[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
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
15 matches
Mail list logo