What is the difference between DATA TYPE AND DATA STRUCTURE? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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...

29th Mar 2022, 10:49 AM
Yusra
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...
29th Mar 2022, 11:14 AM
Jayakrishna 🇮🇳
+ 3
Jayakrishna🇮🇳 confusion is that , list is a data type or a data structure ? It seems same
29th Mar 2022, 10:59 AM
Yusra
+ 3
Jayakrishna🇮🇳 thank you for the explanation
29th Mar 2022, 11:47 AM
Yusra
+ 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...
29th Mar 2022, 10:55 AM
Jayakrishna 🇮🇳
0
You're welcome Yusra
29th Mar 2022, 1:08 PM
Jayakrishna 🇮🇳