- #1
fog37
- 1,401
- 95
- TL;DR Summary
- understand the difference between Variable, Data Type and Array Data Structures.
Hello,
In Python and other programming languages, data can be of different types: integer, float, string, Boolean. On the other hand, Data structures are containers of data items which can (or not) have the same data type.
A variable, when created, has:
a) name (a piece of data stored in memory and separate from the data the variable points to)
b) memory address of the memory cell or multiple consecutive cell where the data content of the variable is stored (he content can be a data item of different type)
Is that correct?
Is a Python list (or a set, dictionary, etc. all examples of data structures) also to be considered a "variable"? The list has a name, memory address, data content. All the data content of the list should be stored in consecutive memory cells, I believe.
Or does each item in the list represent a variable on its own?
Thanks!
In Python and other programming languages, data can be of different types: integer, float, string, Boolean. On the other hand, Data structures are containers of data items which can (or not) have the same data type.
A variable, when created, has:
a) name (a piece of data stored in memory and separate from the data the variable points to)
b) memory address of the memory cell or multiple consecutive cell where the data content of the variable is stored (he content can be a data item of different type)
Is that correct?
Is a Python list (or a set, dictionary, etc. all examples of data structures) also to be considered a "variable"? The list has a name, memory address, data content. All the data content of the list should be stored in consecutive memory cells, I believe.
Or does each item in the list represent a variable on its own?
Thanks!