Karsten Hilbert writes:
Python 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more
information.
>>> tex = '\sout{'
>>> tex
'\\sout{'
>>>
Am I missing something ?
surprises today... Except "maybe you meant
'=='..." caught my attention. _Could_ that be what someone would want
in this situation I wondered? So I tried:
>>> x,2,z == [1,2,3]
(1, 2, False)
Now that made me laugh.
- Alan
[ Some people reading this will be t
d far from the
general python user community. Python has moved from
the BDFL/Bazaar to the Committee/Cathedral. Probably
an inevitable consequence of its current "popularity".
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gau
s to mentally negotiate.
The advantage of the original version is that you can
ignore errors and read the code easily. You only need
to find the except clause if you need to know how errors
will be dealt with. But if comprehending the core
functionality of the code you can just ignore all
the error h
rm agnostic solution. But that didn't work for me
in IDLE either. I think this is one where the best bet is to go
into the IDLE code and add a Shell submenu to clear screen!
Apparently it's been on the workstack at idle-dev for a long
time but is considered low priority...
--
Alan G
Aut
y nightmare created by python, pip
> and all the rest cannot be resolved otherwise.
I've honestly never experienced this "nightmare".
I install stuff and it just works.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/
"batch" mode. So many options.
Most of the specs are available online and there must be dozens of
terminal emulators around written in C so you should have plenty
of sample code to study. Good luck!
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://
w the
line somewhere.
The fact that Python error messages often fail to mention the actual
objects that caused the error has always annoyed me. I've always
presumed that for some reason it just wasn't easy to do. And it's never
been more than a minor annoyance to me.
So the OP is not wrong for wishing for this. Other programming
languages do it. Other Python programmers miss it.
- Alan
--
https://mail.python.org/mailman/listinfo/python-list
"".join \
(
repl.get(s, s)
for repl in (dict(replacements),)
for s in
re.split("\\b(" + "|".join(re.escape(s[0]) for s in
replacements) + ")\\b", text)
)
How about just:
repl = {
"a" : "b",
"c" : "d",
"e" : "f",
"g" : "h",
}
"".join(repl.get(s, s) for s in re.split(r"\b", text))
- Alan
--
https://mail.python.org/mailman/listinfo/python-list
cr.refresh(). # make it visible
else: scr.addstr("Sorry, no colors available")
curses.wrapper(main)
HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/ala
rs.
There seem to be several derivation sources including a fantasy world
city suspended above a very thin, tall steeple
Personally, I know SIGIL as an opensource EPUB editor!
None of them seem to have any direct connection to the xkcd cartoon.
--
Alan G
Author of the Learn to Program web site
.
Flask is a third party package that you need to install separately
from Python. It does not come as standard. Have you installed Flask
on the computer where you are running your project? If so, how did you
download/install it?
--
Alan G
Author of the Learn to Program web site
http://www
And not just Google, I just tried bing, yahoo and duckduckgo
and they are all the same. Not a one listed anything from
python.org on the first page... In fact it didn't even appear
in the first 100 listings, although wikipedia did manage an
entry, eventually.
--
Alan G
Author of the Learn to
still!)
We've now moved on to the more general issue
of communicating values between event handlers
(although still using the width as our exemplar).
Is this just academic interest or do you have
a specific need for this? If we know the need
we might be able to suggest a specific (and
possibly be
on_configure)
root.mainloop()
print("Ww Outside = <" + str(Ww) + ">")
Notice that the button callback picks up the latest value of Ww.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog
global Ww
>> Ww = root.winfo_width()
>> print("Ww Inside =<"+str(Ww)+">")
>>
>> root = tk.Tk()
>> root.bind('',on_configure)
>> root.mainloop()
>>
>> print("Ww Outside = <"+str(Ww)+&
p()
print("Ww Outside = <" + str(Ww) > + ">")
Produces:
Ww Inside = <200>
Ww Inside = <200>
Ww Inside = <205>
Ww Inside = <205>
Ww Inside = <206>
Ww Inside = <206>
Ww Outside = <206>
HTH
--
Alan G
Author of the Learn to Progr
)
ie making the object behave in a dict-like way. I can't remember how
this is implemented, but you can create the necessary methods to have
your object produce whatever it likes.
All you need to do is subclass collections.abc.Mapping, and
implement __len__, __iter__, and __getitem_
Hello Python
I Need help. it could not be found for PyTorch. It said in the Command Prompt
ERROR: Could not find a version that satisfies the requirement torch (from
versions: none)
ERROR: No matching distribution found for torch, Can you help me?
Thank You,
Best,
Alan.
--
https
on and
that seemed to work just fine:
>>> def g(obj, st): print(st, obj.v)
...
>>> class D:
...def __init__(self,v): self.v = v
...m = g
...
>>> d = D(66)
>>> g(d,'val = ')
val = 66
>>> d.m('v = ')
v = 66
--
Alan G
Author of th
there is probably a catch. But sometimes the simple
things just work?
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
--
https://mail.python.org/mailman/listinfo/python-list
I don't use a GUI builder.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
--
https://mail.python.org/mailman/listinfo/python-list
e Python
>> 3.4.4 Shell...
Python names can't start with a % (its the modulo or
string formatting operator).
I know nothing of the innards of matplotlib so I can only
suggest a closer examination of their tutorial information.
--
Alan G
Author of the Learn to Program web site
ig integers. Probably N is 56 or
48 or 32.
And why 62 bits? Because the bit_count method is certainly written in
C, where every step in bit_count_62 would use 64-bit integers.
If you like this sort of stuff, check out the book "Hacker's Delight" by
Henry Warren. See <https://
jak writes:
Alan Bawden ha scritto:
> Julieta Shem writes:
>
> How would you write this procedure?
> def powers_of_2_in(n):
> ...
>
> def powers_of_2_in(n):
> return (n ^ (n - 1)).bit_count() - 1
>
Great solutio
Julieta Shem writes:
How would you write this procedure?
def powers_of_2_in(n):
...
def powers_of_2_in(n):
return (n ^ (n - 1)).bit_count() - 1
--
https://mail.python.org/mailman/listinfo/python-list
nd it seems I'm not alone. That's a relief.
I'll upgrade to 3.13 when it comes out and hopefully it will go
away. (Another suggestion was to use the homebrew python but I don't
like having any more homebrew stuff than is absolutely necessary!)
Meantime I'll just have to cont
M1 Mac Mini, 16GB Ram
I could upgrade my Python version but I was planning on waiting
for the 3.13 release to finalize first. And I doubt if that's
the cause anyway.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Foll
s.result = "Fail"
print(s.school)
print(s.name)
...
print(s.result)
Just a thought...
PS. There are neater ways to do this but you may not have covered
those yet so I'll stick to basics.
--
Alan G
Author of the Learn to Program web site
http://ww
(and in encryption).
But from both perspectives xor is pretty clearly defined
in how it operates and not, I suspect, what the OP really
wants in this case.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr
uot;VRFY" command. And spammers _did_ abuse it
in exactly this manner. And so pretty much every mail server in the
world disabled VRFY sometime in the 90s.
- Alan
--
https://mail.python.org/mailman/listinfo/python-list
nd emacs both have
comprehensive Python support.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
--
https://mail.python.org/mailman/listinfo/python-list
takes up more time than programming.
And there are many, many books written about how to do it.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
-
d gaining experience for formal analysis and
b) actually performing such an analysis of real design/code
is simply not worth the effort for 99% of the programs you will write.
It is much simpler and faster to just test. And test again. And again.
Especially if you use automated testing tools whic
ome shortened to the function inside a class *is*
its method.
In practice, the message looks like a function call. And
the method consists of the function body (and/or any
inherited function body). Thus every method is a function
(or set of functions) but not every function is a method
(or part
ou need to use self.line
self.line = chip.get_line(l)
if pin...
> def print_name(self):
> print (self.line.name())
>
> def set(self):
> self.line.set_value(1)
>
> def clear(self):
> self.line.set_value(0)
A
nship and not just as a kind
of cheap reuse mechanism - that's when problems start.
Also, mixin style MI is particularly powerful but the
protocol between mixin and "subclass" needs to be carefully
designed and documented. Like any powerful tool you need
to understand the costs of use a
GC, but then
neither does it have an Object superclass so very often MI in C++
does not involve creating diamonds! And especially if the MI
style is mixin based.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follo
onsole/terminal
window by typing python at the command prompt.
If you get the Python prompt:
>>>
Then Python is installed OK.
After that it's back into auto-editor and resolve and this is
not the best place to get answers for those. Resolve at least
has an active support forum, s
d and
reinstalled about twice and still no success hence I uninstalled it.
On Mon, 12 Jun 2023, 23:33 Alan Gauld via Python-list,
mailto:python-list@python.org>> wrote:
On 12/06/2023 10:26, Real Live FootBall Tv via Python-list wrote:
> I did it because I was going to use it with another
s a python interpreter?
ie. Did you get a >>> prompt in a terminal?
and without involvement from your video editor?
If so, what did you do to link it to the video editor?
And what was the result?
Or did Python not even start? How did you try to use it?
What OS are you on? Did the installer
bject is not callable
Ah, now I understand. cubes is a literal list defined in the module.
> But that was spot on, thanks
>
>>>> import cube
>>>> cube.cubes
> [0, 1, 8, 27, 64, 125, 216, 343, 512, 729]
Glad to help.
--
Alan G
Author of the Learn to Program
es\Tools\Python\Temp\cube.py
>>>> cubes
> [0, 1, 8, 27, 64, 125, 216, 343, 512, 729]
cubes looks like it should be a function but in that case there
should be parens after it. So I'm not sure how that is working!
I'd expect that you need to do:
import cube
cu
" the modules. are you typing
>>> import mymodule
at the interactive prompt or are you using the File->Open menu
to load them into the editor? (It sounds like the latter)
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_
t; required?
>
> See PEP 594: https://peps.python.org/pep-0594/
Thanks Cameron.
A scary list; I must have a dozen projects from the late 90s still
live that are using many of these! I'm glad I'm retired and won't
be the one who has to fix 'em :-)
--
Alan G
Author o
why nntplib is deprecated? Surely there are still a
lot of nntp servers around, both inside and outside corporate firewalls?
Is there a problem with the module or is it just perceived as no longer
required?
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazo
text does create in each
> po-file.
Sorry, I've never used pygettext so can't help there.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphot
If you are building terminal based form-type
apps the best bet seems to be urwid. I haven't used it in anger
but the beginner docs I saw looked promising.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo
ow to configure it
(and how to plumb it into your IDE).
Personally I've never felt the need for any stricter error
checking than the interpreter provides so I can't offer
anything beyond the generic suggestion to use a linter.
--
Alan G
Author of the Learn to Program web site
http://www.
o a text editor in the first
instance? And Excel in the second?
If all else fails you can probably write handlers and bind
to Ctrl-C and Ctrl-V to do something yourself that mimics
cut/paste.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan
ine all the operators (commands in Tcl-speak)
in the language so redefining plus is easy. Doing it based on
type is more tricky but doable.
> Unfortunately, if they BOTH are flexible, how do you decide whether to add
> them as numbers or concatenate them as strings?
Yes, that's where it b
ght be a rival to M$
OS/2 running NeXTstep now that would have been a platform
for the 90s... both so near yet so far.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.fli
;ve seen no real evidence of
that.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
--
https://mail.python.org/mailman/listinfo/python-list
ements were before
Python3 so ive no idea what it does today! But a quick check suggests it
still exists and works with python3 code - last major release was in Nov
2022.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my pho
g strong,
albeit at extortionately high prices: $1000~3000 for the pro
versions! (But there is still a free community version with
just the basics.) See http://www.embarcadero.com
And it's targeted at multi-platforms now: Windows, MacOS, Android, iOS
although it only runs on Window
ers of
magnitude more difficult.
The Lazarus open source project is based on Delphi's IDE.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
auto tricks but I don't
always use them. In vim I use auto-indent and that's about it.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
-
e3.config(state="normal")
)
)
It's not a radical change from using a lamba as a
callback but it does extend the use case to cover
a common GUI scenario.
I like it. I wish I'd thought of it years ago.
Thanks for sharing.
--
Alan G
A
onic is still a much more loose term and
the community less stressed about it than their C++
cousins where it has almost reached a religious fervour!
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr a
Guenther Sohler writes:
Hi Python community,
I have a got an example list like
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
T T
and i eventually want to insert items in the given locations
(A shall go between 2 and 3, B shall go between 6 and 7)
Right now i just use ind
ing for static types
should rarely be necessary since Python uses duck typing
and limiting things to a hard type seriously restricts your code.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
h
compile(m0)
s0 = r0.match(s)
>>> print(s0)
None
Assuming that you were expecting to match "pn=2017", then you probably
don't want the 'match' method. Read its documentation. Then read the
documentation for the _other_ methods that a Pattern supports. T
e (and standard library) as it exists.
(We also cover beginner questions about programming in general.)
So this thread is most definitely in the right place IMHO.
--
Alan G
Tutor list moderator
--
https://mail.python.org/mailman/listinfo/python-list
) is a now more complicated than before. So
I have to be very highly motivated to jump through the hoops.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauld
axed the ludicrously strict typing slightly. Turbo Pascal
made Pascal a joy and I still use Delphi for Windows programming today.
TP also introduced classes to Pascal (although Apple had already done
so for the Mac and Borland basically ported the syntax to the PC).
--
Alan G
Author of the Lea
uld chain them. But sadly it doesn't.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
--
https://mail.python.org/mailman/listinfo/python-list
ecimal
accuracy is your primary goal, it might suit you better.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
--
https://mail.python.org/mailman/listinfo/python-list
On 12/12/2022 17:45, Alan Gauld wrote:
Absolutely nothing apparently!
But in practce I did pen some esponses to Davids post. However
this list seems to strip out what I've written, its happened
a few times now. Not every time but enough that I rarely post
here.
But I'll try once mor
rd-python
>
> Disclaimer: have had it on my 'radar', but never actually employed.
> (if you have considered, will be interested to hear conclusions...)
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
--
https://mail.python.org/mailman/listinfo/python-list
On 03/11/2022 18:29, Chris Angelico wrote:
> On Fri, 4 Nov 2022 at 05:21, Julieta Shem wrote:
>>
>> Chris Angelico writes:
>>
>>> On Thu, 3 Nov 2022 at 21:44, Alan Gauld wrote:
>>>> Also Python is not a purely OOP language, in that you can write
>&g
ut you really have to fight the system to
do so.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
--
https://mail.python.org/mailman/listinfo/python-list
I'd implement the example hierarchy as
>
>>>> class Language:
> ... def f(self):
> ... print(self.greeting)
And that would be perfectly valid too.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/aut
xactly as in
cellular automata theory. ..
Unfortunately, there is a huge gap between pure OOP theory and
practical OOP languages! And just as big a gap between OOP language
potential and real-world OOP usage. Very few purely OOP programs
exist (maybe excepting in Smalltalk - see Stefan's posts
f __str__(self):
> return "Empty()"
> def __repr__(self):
> return self.__str__()
> def __new__(clss):
> if not hasattr(clss, "saved"):
> clss.saved = super().__new__(clss)
> return clss.saved
>
> class Stack(Pair):
> def pop(self):
> return self.first
> def push(self, x):
> return Stack(x, self)
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
--
https://mail.python.org/mailman/listinfo/python-list
Cecil Westerhof writes:
Alan Bawden writes:
> Cecil Westerhof writes:
>
>Yes, I try to select a random element, but it has also to be removed,
>because an element should not be used more as once.
>
> Instead of using pop to do that why
g to have it destroyed by this process:
seq = list(seq)
n = len(seq)
while n:
i = randrange(n)
yield seq[i]
n -= 1
if i < n:
seq[i] = seq[n]
--
Alan Bawden
--
https://mail.python.org/mailman/listinfo/python-list
e
_same_ dictionary every time. Your original code that used a `for' loop
is actually much clearer.
--
Alan Bawden
--
https://mail.python.org/mailman/listinfo/python-list
ng for is usually called "argmax" and
"argmin" (see ). These don't exist in
the standard Python library as far as I can tell, but numpy does have
"argmax" and "argmin" routines.
--
Alan Bawden
--
https://mail.python.org/mailman/listinfo/python-list
Marco Sulla writes:
On Mon, 9 May 2022 at 19:53, Chris Angelico wrote:
...
Nevertheless, tail is a fundamental tool in *nix. It's fast and
reliable. Also the tail command can't handle different encodings?
It definitely can't. It works for UTF-8, and all the ASCII compatible
single
of the discussions there will be
closer to your level than the more advanced topics that
get addressed here.
Finally, I have a tutorial aimed at complete beginners,
see the link below...
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_
I
displays but so does a Terminal in the background. The SO answer
does mention you can get the Terminal to close when the
script terminates whhich would be better than now. However,
another answer mentions something called Automator, which
I'll need to Google...
Thanks for the pointer thou
escript or somesuch?
Alan G.
--
https://mail.python.org/mailman/listinfo/python-list
somewhere.
But it might be possible to divide and conquer and get better
speed. It all depends on what you are doing. We can't tell.
We cannot answer such a vague question with any specific
solution.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon
And I missed one that was just published last month:
https://datatracker.ietf.org/doc/html/rfc9171
Unlike RFC 5050, this version of the protocol actually claims to be a
"Proposed Standard".
--
Alan Bawden
--
https://mail.python.org/mailman/listinfo/python-list
ps://en.wikipedia.org/wiki/Delay-tolerant_networking
https://datatracker.ietf.org/doc/html/rfc4838
https://datatracker.ietf.org/doc/html/rfc5050
--
Alan Bawden
--
https://mail.python.org/mailman/listinfo/python-list
xv', 'exceptions', 'http', 'item', 'link',
'linkextractors', 'selector', 'signals', 'spiders', 'twisted_version',
'utils', 'version_info']
> I wish there was a convenient way for me
David Lowry-Duda writes:
...
For the same reason that the following code doesn't do what some people
might expect it to:
```python
def add_to(elem, inlist=[]):
inlist.append(elem)
return inlist
list1 = add_to(1)
list2 = add_to(2)
print(list1) # prints [1
w the target
to be as general as possible!
I'm guessing that about 70% of you will think that this is a horrible
idea, 10% of you will find it compelling, and the remaining 20% will
find themselves conflicted. You can count me in that last category...
--
Alan Bawden
--
https://mail.python.o
in transit.
Presumably, especially for large numbers, a single python loop
is faster than 2 C loops?
But that's purely my speculation.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr
uot; :
> print("Wait hold on! are you really leaving??")
>
> #User answers
> answer = input()
> #If user says 'yes' again, reply 'fine! bye then!'
> if answer == "yes" :
> print("Fine! bye then!")
Shouldn't those lines
dead code (possibly emitting
a warning in the process?).
A linter likewise might identify the redundant code.
I don't use any python linters, does anyone know if they do
detect such dead spots?
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/au
ction of small C programs of mine I find:
>
> 35 regular for loops
> 28 while loops
> 2 infinite for loops
> 1 "infinite" for loop (i.e. it exits somewhere in the middle)
> 0 do/while loops.
That wouldn't surprise me, I've only used do/while in C
a handful o
On 10/09/2021 19:49, Stefan Ram wrote:
> 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 tea
cases, it executes the 'else' part if it didn't break out of the
> loop. That's it.
OK, That's a useful perspective that is at least consistent.
Unfortunately it's not how beginners perceive it and it causes
regular confusion about how/when they should use els
state that the use of for loops was rare?
But I would hope that any empirical research would
look at the wider function of the loop and its
purpose rather than merely analyzing the syntax
and keywords.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.c
ys gets executed at least once. But at
the cost of duplicating the loop-body code, thus violating DRY.
Just another thought...
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://ww
e {
> #define ENDIF }
> ...
>
> IIRC he copied them out of a magazine article.
That was quite common in C before it became popular(early/mid 80s).
I've seen Pascal, Algol and Coral macro sets in use.
You could even download pre-written ones from various
bulletin boards (remember them
issue - except
we'd be an hour out of sync with the EU. (Post Brexit that may
not be seen as a problem!! :-)
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
--
https://mail.python.org/mailman/listinfo/python-list
people. Most still see it
as a benefit because they get longer working daylight.
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos
--
https://mail.python.org/mailman/listinfo/python-list
from DELL but the EU PCs had a slightly
different BIOS).
The differences you cite should have thrown up issues every year.
I must see if I can find my old log books...
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my
1 - 100 of 1258 matches
Mail list logo