Error Testing

Chris Angelico rosuav at gmail.com
Sat Oct 19 18:28:03 EDT 2013


On Sun, Oct 20, 2013 at 3:22 AM, rusi <rustompmody at gmail.com> wrote:
> The problem is that python is an imperative language and uses the '=' sign for assignment.  In math of course '=' stands for equality.

Pascal tried to create a new operator, := to be read "becomes", to
deal with the whole equality-vs-assignment issue. Did it really help
anything? I don't think so. Just syntactic salt. Even the comparison
isn't really mathematical - in maths, "x = y" is a statement of truth,
whereas in programming, it's a question ("is x equal to y").

Teaching maths and programming at once is like teaching any other two
arts at once - there'll be differences to grok as well as similarities
to jump on. I would say that the expression evaluator in (almost) any
modern language is a fairly close parallel to standard mathematical
expressions; yes, abutting tokens is multiplication in algebra, but on
the flip side, we don't use (or need) subscript to make multi-letter
identifiers in code. Programming uses more words and less blackboard
notations (compare abs(x) to |x| for example), but it's expressing
things in fairly similar ways most of the time.

ChrisA



More information about the Python-list mailing list