+ 2
What is the difference between DATA TYPE AND DATA STRUCTURE?
Like list is a data type but sometimes refers to data structure as well...
5 Answers
+ 1
Data types in python are 2 types.
Primitive data types and reference data types
int, float, bool are primitive data types
Tuple, list, dictionary,.. are reference data types..
All are called data types in python because all are objects. Implemented as classes. In general, an object is a variable of class data type.
Generally , List is a data structure.
It can hold data in linearly..
But in python, a type is used determine in which structure it is storing data for data structures. And type of data it holding for primitive data type.
P.S : all are called data types in python. all data structures are refered as data types but not all data types are data structures..
"Data structure is a container for holding multiple data. it's dynamic in nature, according to size"
hope it make sence, and helps...
+ 3
Jayakrishna🇮🇳 confusion is that , list is a data type or a data structure ? It seems same
+ 3
Jayakrishna🇮🇳 thank you for the explanation
+ 1
Data structure are able hold a collection of data while data type refers to type of data that can be hold into the variable.
int, float are data types but not data structure
tuple, list,.. are example of data structures...
0
You're welcome Yusra