Is a variable the name, the value, or the memory location?

前端 未结 4 764
遥遥无期
遥遥无期 2020-11-30 11:39

I\'ve been learning Python for a few months, and also know very little C, and I was wondering if anyone could clear this doubt up for me:

Is a variable the name, the

4条回答
  •  萌比男神i
    2020-11-30 12:10

    There is a space somewhere in a memory where the values are stored. These memory is then located through address which is usually represented by hexadecimal number, or sometimes binary number. So, these numbers are hard to remember for programmer, so they used the term variable to refer to that memory location in a easy way, or you can say higher abstraction. So, x is just a name that refers to some location in the memory which contains value of 5. That's all!

提交回复
热议问题