[Edu-sig] Setting a variable's value

Andre Roberge andre.roberge at gmail.com
Thu May 11 15:57:35 CEST 2006


On 5/11/06, Winston Wolff <winstonw at stratolab.com> wrote:
> I'm considering a proposal for Python 3000 and want to get some other
> opinions.  I propose adding an alternative syntax for assigning a
> value to a variable so that the Python statement:
>         a = 1
> could also be written:
>         a := 1
> The reason is to help students who are familiar with the Algebraic
> meaning of "a = 1" (a is always equal to one) and get confused when
> the Python meaning of "a = 1" (put the value of one into the variable
> a).
>
> I teach middle and high-school students who are learning Algebra at
> the same time as Python, and it is very confusing to them when the
> same symbols mean two subtly different things.  I would propose that
> the second syntax (a := 1), be available so that I could introduce
> that in the first semester course.  Later, once they understood the
> meaning of "a := 1", they could switch the shorter syntax "a = 1".
>
> Any opinions?
>
Since you ask!...

I do not like it.  In Python you can do things like
a += 1
a -= 1
a *= 1
a /= 1   # :-)

Students will be familiar with ":" meaning div


> -Winston
>
>
>
> ______________________________________________________
> winston wolff - (646) 827-2242 - http://www.stratolab.com
> learning by creating - video game courses for kids in new york
>
>
> _______________________________________________
> Edu-sig mailing list
> Edu-sig at python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>


More information about the Edu-sig mailing list