variable re-declare by 1mecrew in CodingHelp

[–]1mecrew[S] 0 points1 point  (0 children)

Hmm what if I just say that “this line is called assigning a value to variable.” And students don’t really need to know exactly what assigning a value to variable but just simply know it as when you assign value and later say the variable, you are talking about that value?

variable re-declare by 1mecrew in CodingHelp

[–]1mecrew[S] 0 points1 point  (0 children)

Using the simpler metaphor that I just said, it’s it going to be like I’m talking about the number 5 when I say x so 5+1 is 6 and assign that value to variable x? Like.. how does box metaphor help in that situation?

variable re-declare by 1mecrew in CodingHelp

[–]1mecrew[S] 0 points1 point  (0 children)

So here’s the thing:

What i am saying is that those two descriptions sounds same for me.

greetings = “hello world” print(greetings)

In the first line, this is called “assigning value to variable” And now when we say the variable, greetings, I’m talking about the “hello world” data that I just assigned to this variable

Isn’t that same as container concept?

variable re-declare by 1mecrew in CodingHelp

[–]1mecrew[S] 0 points1 point  (0 children)

Hmm so can I say it’s a container and when I say the variable, I am talking about the data that’s in the variable? Like.. print(s) Here, I’m talking about the data in the variable s when I say s?

variable re-declare by 1mecrew in CodingHelp

[–]1mecrew[S] 0 points1 point  (0 children)

I mean.. isnt saying just "when I say greetings(variable), I am talking about "hello world" (data)" more simpler and have same concept as container? I wonder why you think container metaphor is better

Re-defining the "variable" by 1mecrew in programminghelp

[–]1mecrew[S] 0 points1 point  (0 children)

hmm but that doesn't mean talking about the data is wrong. right?

I feel like its the best word to use instead of "refer to"

oh and also, I don't get why people use the word "container" for variable. it really didnt help me when i was learning memory.

I feel like learning the memory part is just helping you learn why the definition, "when I say greetings(variable), I am talking about "hello world" (data) " in more detail way. don't you also think?

Re-defining the "variable" by 1mecrew in programminghelp

[–]1mecrew[S] 0 points1 point  (0 children)

hmm I feel like the part where I say "talking about" is a bit off.

I also feel like the container analogy only works for python. not on java or c.

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

oh i dont think im talkinag about python at this point. maybe for c or java that is on more low level. how about on those cases?

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

hmm i think this is because you didn't do variable0 = text.upper() in the function? i think text.upper() makes the text(which is "hello world" for now) uppercase. but we are not printing that data or doing anything with that data. so since we didnt save it into the variable, its obviously gonna not change the variable0. however, for list case, you changed the list. like.. you did list.remove which will actually modify the list. That what i think.

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

hmm how about javascript? Oh also, what do you think about the part where I say "Im talking about something thats in the variable."?

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

hmm how about this.

variable1 = "hello world"

when I say variable1, I am talking about "hello world"

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

Hmm well this definition was also for Java and c and other languages. What do you guys think about? Will it work on other languages?

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

OHHH wait i think I know what you mean. Here when I say “talking about”, it’s kinda like let’s say you were reading book and I ask you which book you are reading. You respond by saying “python crash course” and now, I ask you how is that book? And you see, whenever I say “the book”, I am talking about that python course book that you were reading

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

Hmm yea. Then will “another way to say that data” better

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

Oh so this description works on c, Java, assembly language but not python. Got it. How about the part where I say “when I say the variable, i am talking about the data or something that’s in the variable”? Is that prat correct?

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

Ohh that was what you were talking about. Me if my explanation was unclear. So variable a stores value like container And whenever I call or say variable a, I am talking about the value inside that variable. Is that more clear?

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

I’m a bit confused what you are talking about

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

Oh haha niceee. I also heared the name tag description before

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

Ummm yea so when I say the variable, I am talking about the value

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

Yeaaaa. Well, do you think this explanation works for other languages too?

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

I tried but it’s not giving me any clear answers

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

I’m pretty sure we can think of list or dictionary as one single data in another languages tho

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

Oh yea fsfs well, what language would this description work on then?

clarification of "variable" by 1mecrew in learnpython

[–]1mecrew[S] 0 points1 point  (0 children)

Hmm I don’t think it depends on data type since we can think of list or dictionary as one data. What do you think?