[Edu-sig] Re: easy for beginners, even children
Daniel Ajoy
dajoy at openworldlearning.org
Thu Apr 15 13:17:04 EDT 2004
On 15 Apr 2004 at 12:03, Michael McLay <mmclay at comcast.net> wrote:
> Reusing the same spelling for both assignment and equality would present
> problems in expressions.
> >>> a = 1
> >>> b = 4
> >>> a = b == 3
> >>> a
> False
> >>> a = b = 3
> >>> a
> 3
> >>> b
> 3
> >>>
If the creators of Python wanted it to have a notation more math
inclined they should have chosen = for equality and some other
notation for assignment. Logo does that.
? make "a "true
? make "b "false
? make "a :b = "true
? show :a
false
in Logo, the notation for equality is very different from the
notation for assignment. So I would say Logo makes this difference
more explicit than Python.
Python accepts this without complaining:
a = 3
a = a + 1
but it is not mathematically correct. A student talking with his
math teacher could say: "But I saw it programming class".
Daniel
More information about the Edu-sig
mailing list