[Edu-sig] the zip( ) function in Algebra 2?

Kirby Urner kurner at oreillyschool.com
Fri Aug 30 02:53:49 CEST 2013


I make a big deal out of this Python fragment
in a Math Forum essay I recently posted:

>>> result = zip({"planet", "comet", "sun"},
   {"paramecium", "duck", "aardvark"},
   {"banana", "apple", "orange"})
>>> list(result)
[('planet', 'aardvark', 'orange'),
   ('sun', 'paramecium', 'apple'),
   ('comet', 'duck', 'banana')]

The indentation is artificial and in gmail the
>>> lines are blue, because that's how the
Math Forum archives treats it, but other than
that, it's unadulterated cut 'n paste Python.

What might drive a reader crazy is it looks
like it should maybe pick "the next" element
from each set to form its groupings, and it
does, but then sets have no order, no ranking,
no index.  So even though "aardvark" is
right-most in the set, it's the first picked.

Python veterans get it right away and aren't
phased, and we don't have Python to blame,
are not assigning blame at all.  This is pure
math in an elementary form:  sets have no
"first or last" so don't expect sets to behave
like lists or tuples.  Python got it right, so no
apologies.

So how isn't this like "algebra" again?  I went
through it twice, as a student and as a teacher,
and I can assure you, if "high school algebra"
is important then "computer language in a
console" is important.  We knew that as long
ago as the 1980s.  I have other recent essays
reminiscing, sharing analysis.  There's lots to
discuss, about why we didn't get there.

Entry point to more writings:

http://mathforum.org/kb/thread.jspa?threadID=2592483

Kirby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20130829/7331c5b1/attachment.html>


More information about the Edu-sig mailing list