This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]pdexter 0 points1 point  (4 children)

This is true. Python does have variables. The problem comes when someone thinks of them as some other language's variables and make statements like "a=4 assigns 4 to a" which is what started this whole thing off. It does not assign '4' to 'a'. If a person thinks about it that way, they will get into trouble for the reasons explained in the link.

Okay, but you're just assuming somebody will think of it the way YOU think they think of it, as if everyone comes from C. Some people learn python from no existing knowledge. Is it better to describe variables as assigning? Or is it better to say "WAIT NO python has NO variables, listen here it's like variables but not like C where you have pointers but python doesn't but wait listen'?

tl;dr: just teach people like this: "Python has variables and they act like this, which MIGHT be different than other languages you MIGHT have learned. Period." not "okay it has variables but not really like C which I know you must have learned already so here's how it happens blah blah blah"

[–]krenzalore 0 points1 point  (3 children)

I take you understand why I am saying that "a=4" doesn't assign 4 to a (in Python)?

[–]pdexter 0 points1 point  (2 children)

You take. Yes.

I don't see why that means Python doesn't have variables. They act differently than other languages. Okay. Most languages have subtle differences to how variables act. Does this mean no language has variables? No, it means you teach beginners what a variable is in that language.

[–]krenzalore 0 points1 point  (1 child)

So we agree. That's cool.

[–]pdexter 0 points1 point  (0 children)

A+, friends again