I encourage Pythonistas into teaching Python in the context of generic
computer science and mathematics, high school and above (and below for the
precocious) to consider "indigs" an accessible example of recursion at
work.
I'm testing it out in a warm up section students might visit if feeling
shaky on their Python, or just wanting more background reading.
https://github.com/4dsolutions/clarusway_data_analysis/blob/main/python_war…
The idea of an indig is very simple and inherits from numerology, a kind of
primordial NLP:
Take any positive integer, split it into individual digits, add those
digits, if the sum is a single digit you're done, otherwise: repeat.
Examples:
32986513 = 3+2+9+8+6+5+1+3 = 37 = 3+7 = 10 = 1+0 = 1
59865279171 = 5+9 = 14+8 = 22+6 = 28+5 = 33+2 = 35+7 = 42+9 = 51+1 = 52+7 =
59+1 = 60 = 6+0 = 6
I got it down to this, but it's no crime to take a few more lines.
def indig(n: int):
return n if len(str(n))==1 else indig(sum(map(int, list(str(n)))))
It's not important that "taking the indig of a number" be considered
"meaningful" in any way. What's useful about it is it introduces type
conversion (int to string digits, back to single ints for summing) as well
as recursion.
This idea and algorithm may well have been proposed and used before in the
literature. Sounds Martin Gardnery. Maybe it's in Knuth already. I'm not
trying to establish priority for anything, only circling what looks like
promising pedagogy going forward and sharing it with peers.
Kirby
To edu-sig:
---------- Forwarded message ---------
From: Kirby Urner <kirby(a)clarusway.com>
Date: Sun, Aug 18, 2024 at 7:32 AM
Subject: Fwd: Side topic: IDEs
To: kirby urner <kirby.urner(a)gmail.com>
Feel free to write to me at Clarusway as well.
Kirby
---------- Forwarded message ---------
From: Kirby Urner <kirby(a)clarusway.com>
Date: Wed, Jul 24, 2024 at 4:26 PM
Subject: Side topic: IDEs
To: Edwin W <edwin(a)clarusway.com>, kirby urner <kirby.urner(a)gmail.com>
Hi Edwin --
I thought we could have more than one thread going, branching off Incoming
Cohort Planning (ongoing).
I've seen and taken various approaches to the topic of Interactive
Development Environments. Here are some talking points I've used:
* you the developer have a choice from a huge variety of IDEs
<https://www.creativebloq.com/advice/best-code-editors>, and they continue
to evolve.
* Don't be afraid to sample several.
* Even when you have a favorite, you might want to keep dabbling with the
competition, just to see what they're like
* IDEs divide into two major categories:
(a) IDEs that work with many computer languages, usually by means of "plug
ins"
(b) IDEs devoted to one primary language only (example: Spyder)
Screenshot of me using Spyder just now (when I wanted to test that pi
generator again):
[image: Screen Shot 2024-07-24 at 4.18.08 PM.png]
Sometimes I talk about the history, meaning the lineage, meaning some IDEs
grew up inside Windows whereas others derive from a Linux/Unix/Mac
background (vi vim emacs).
If I'm sharing my screen, I can show some of these IDEs while I mention
them, otherwise it can just be information embedded in some Notebook.
I used IDLE for years, the IDE that comes with Python when you get it from
Python.org. Anaconda gives you Spyder.
One reason Python became very popular is because IDLE is cross platform,
running in Windows, Mac, Linux pretty much the same way. Guido got a US
government grant to work on IDLE (even though he's a Dutch citizen).
When I worked for O'Reilly School of Technology, we had our students using
remote (cloud based) versions of Eclipse, which was cutting edge but also a
bit awkward.
Eclipse <https://en.wikipedia.org/wiki/Eclipse_(software)> (open source
project of IBM) features plug-in architecture and works with many
languages, but was especially made for Java.
I understand that the Clarusway Python courseware is Notebook based, which
is not a problem, that's a good environment.
I was just wondering if you think it's worthwhile to talk about IDEs, how
they are different from Notebooks, and how a Python coder has a choice from
many of them.
I like how Spyder integrates features and have used it a lot when sharing
from an IDE when teaching Python online.
Kirby