On 12/09/2021 09:11, jak wrote:
> if the only way to terminate a 'while True' loop is by using the 'break'
> statement, why is it allowed to add the 'else' statement which will only
> contain dead code?
>
> while True:
> break
> else:
> print('dead code')
>
Because to the interpreter
Some of what I read makes me chuckle.
Yes, large units of code, and even smaller ones, may be a chore to figure
out. Arguably harder when you use indentation and the next/last parts are
not even on the same screen as the rest. Sometimes you want to use a
split-screen in some editor to line up the
On 2021-09-12 10:28:22 -0700, 2qdxy4rzwzuui...@potatochowder.com wrote:
> On 2021-09-11 at 18:21:17 +0100,
> Alan Gauld via Python-list wrote:
> > On 11/09/2021 15:41, Peter J. Holzer wrote:
> > > How is C's do/while loop more horrible than Pascal's repeat/until?
[...]
> > so code that has
> >
>
Many of those 4.8K "users" might be using indirectly via some other dependency
- I'm not sure how GitHub calculates "used by", but even if it were a direct
dependency, one has no idea if it's actually being used or not. so I tend not
to worry about such things. My distlib library has only 2 star
Stefan,
Agreed that writing code to handle all possible eventualities is usually
overkill and results in bloated software delivered very late or not at all.
My point is that often OTHERS start adding requests afterward that seem
trivial to THEM as they have no idea what it takes. I have often don
The topic of looping and our current discussion stimulates me to ask if
someone has categorized the uses of loops and it seems something obvious.
Once you know what kinds of loopy looping there are, it can get easier to
decide which, if any, of the methods to set up a loop make more sense.
Compute
On 2021-09-11 at 18:21:17 +0100,
Alan Gauld via Python-list wrote:
> On 11/09/2021 15:41, Peter J. Holzer wrote:
>
> > How is C's do/while loop more horrible than Pascal's repeat/until?
>
> Because it is very hard to spot or distinguish from a normal
> while loop.
>
> while condition ;
>
> I
Used by 4.8k but only ... 4 stars
--
https://mail.python.org/mailman/listinfo/python-list
Il 11/09/2021 22:29, Avi Gross ha scritto:
Alan and others,
I think human languages used to make computer languages will often cause
confusion.
Some languages have an IF .. ELSE construct but also an EITHER ... OR and a
NEITHER ... NOR and other twists and turns like words that sometimes come
On Sun, 12 Sep 2021 10:11:15 +0200, jak wrote:
> -- snip --
>>
>> An inconsistency that I have been able to notice is this:
>> someone suggests to remedy the absence of the do-while with:
>> while True:
>> ...
>> if condition:
>> break
>> the problem arises if the while has
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> Alan Gauld writes:
>>OK, That's a useful perspective that is at least consistent.
>>Unfortunately it's not how beginners perceive it
> ...
>
> Beginners perceive it the way it is explained to them by
> their teacher.
My life as a professor would
-- snip --
An inconsistency that I have been able to notice is this:
someone suggests to remedy the absence of the do-while with:
while True:
...
if condition:
break
the problem arises if the while has an else of its own because the break
not only blocks the while loop but
On 2021-09-11, Chris Angelico wrote:
> Once you accept that "perfectly representable numbers" aren't
> necessarily the ones you expect them to be, 64-bit floats become
> adequate for a huge number of tasks. Even 32-bit floats are pretty
> reliable for most tasks, although I suspect that there's l
On 11/09/2021 15:41, Peter J. Holzer wrote:
> How is C's do/while loop more horrible than Pascal's repeat/until?
Because it is very hard to spot or distinguish from a normal
while loop.
while condition ;
Is a valid (and fairly common) loop in C
so code that has
do{
code
}
while condition;
L
On 2021-09-11 21:38:02 -0400, Avi Gross via Python-list wrote:
> Peter, in your own personal finite sample, I am wondering what you might do
> TODAY if you looked at your loops again and considered redoing them for an
> assortment of reasons ranging from using the code for teaching to efficiency
>
15 matches
Mail list logo