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 handling blocks.
. 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
Author of the Learn to Program we
> 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/alan_gauld
Follow my photo-blog on Flick
"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://
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
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
# 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/alangauldphotos
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
http:
s 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.alan-g.me
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 Prog
'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 better?)solution.
--
re)
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 on Flickr
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)+">&
("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 Program web sit
aking 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__. Pretty easy
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
gt;>> 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 the Learn to Program web site
http://www.alan-g.me.uk/
http://
ly 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
e 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
http:
tegers. 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://en.wikiped
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 continue nudging the mouse as
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
Follow my photo-blog on Flickr at:
http
"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://www.alan-g.me.uk/
http://www.ama
sts (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 at:
h
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
ave
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
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
--
ht
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 which is th
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 of on
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)
As you do here.
--
Alan G
Author of the Learn to Program
ust 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 as well as the potent
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
Follow my photo-blog on Flickr at:
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, so I'd start there(as
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 ap
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 ru
ot 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 web site
h
\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
cube.cubes()
--
Alan G
Au
; 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_ga
quired?
>
> 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 of the Learn to Program we
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.amazon.com/author/al
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/alangauldphotos
--
https:
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-blog on Flickr
ow 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.alan-g.me.uk/
http://www.amazon.
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_gauld
Fol
ll 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 becomes a d
e 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.flickr.c
o 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
ython3 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 photo-blog on Flickr at
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 Windows.
--
Alan G
Author of the Learn to Program
nitude 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
--
https://ma
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
--
https://mail.pyth
;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
Author of the Learn to Program web site
http:/
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 at:
http://www.flickr
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
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:
http://www.flick
)
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. Then you
will be enlighten
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
stuff) 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
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 Learn to
hain 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 more
r: 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
>
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/author/alan_g
n
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 again). :-(
--
Ala
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
e willing 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
time. Your original code that used a `for' loop
is actually much clearer.
--
Alan Bawden
--
https://mail.python.org/mailman/listinfo/python-list
looking 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
here 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_gauld
Follow my p
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 though.
--
Alan G
Auth
or somesuch?
Alan G.
--
https://mail.python.org/mailman/listinfo/python-list
re.
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.com/author/ala
Alan WiIliams added the comment:
Hi, I'd like to work on this issue. Based on the discussion, the main thing to
do here is to raise a deprecation warning when isdst is used?
--
nosy: +Alan.Williams
___
Python tracker
<https://bugs.python.
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
g/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
nvenient way for me to know what
> all of these are.
help(scrapy.http)
help(scrapy.spiders)
etc...
And if it turns out they are not functions or classes
you can use [p]print to get the values. You can also
use type() to clarify what kind of thing an attribute is.
--
Alan G
Author of the Learn to Progr
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
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.org/mailman
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 at:
http:
)
>
> #User answers
> answer = input()
> #If user says 'yes' again, reply 'fine! bye then!'
> if answer == "yes" :
> print("Fine! bye then!")
Shouldn't those lines be indented as part of the if statement above?
> #Other than that if user says 'no', reply
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/author/alan_gauld
Follow my photo-blog on Flick
mall 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 of times. But in Pasc
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 teacher.
I'm
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 else with a loop.
--
Alan G
Aut
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.com/au
lways 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?!
cept
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
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
he 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 photo-blog on
control becomes important. Also the problems we had were about
15 years ago, things may be better ordered nowadays. (I've been
retired for 7 years so can't speak of more recent events)
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Foll
updates showing as having happened in
the future!
--
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
1 - 100 of 1489 matches
Mail list logo