Beginner Guide :Python Data Types

Sayali Kumbhar
3 min readApr 25, 2024

--

Hey folks👋 ,

Let’s talk about the different data types in python. before starting with data types if you are not aware about python syntax then click here to read my previous blog. Now ready to go with next step on learning Python Programing. before we dive into data types let’s first understand

what is data type?

Data types are nothing but the type of data we stored in variables, according to data types we can perform associate operation on it.

data types are used to ensure that the data is collected in preferred format and value of each property as expected

different types of data types in python:

Python data types are broadly categories in following type:

1.Numerical Types:

Integers (‘int’): Integer data types contains Whole numbers without floating point/ decimal point.

Floating-point numbers (‘float’): Floating point number contains real numbers with a decimal point.

Complex numbers(‘complex’): Complex number contains Number with a real and imaginary part, represented as ‘a + bj’ , where a and b are floats number and j in the imaginary unit.

2. Text Type:

String(‘str’): String data type is nothing but the Sequence of characters enclosed within single or double quotes or triple quotes.

3. Sequence Types:

List(‘list’): it is simple ordered and mutable collections of items.

Tuples(‘tuple’): Ordered and immutable collections of items.

Range(‘range’): Represents a sequence of numbers generated by the ‘range()’ function.

4. Mapping Type:

Dictionaries(‘dict’): Unordered collections of key-value pairs, where each key is unique and associated with a value.

5. Set Types:

Sets(‘set’): Unordered collection of unique elements.

Frozen Sets(‘frozenset’): these are Immutable sets, similar to sets but cannot be modified after creation.

6. Boolean Type:

Booleans(‘bool’): Represents the truth values ‘True’ and ‘False’.

7. Binary Types:

Bytes(‘bytes’): Immutable sequences of bytes.

Byte Arrays(‘bytearray’): Mutable sequence of bytes.

let’s Understand data types practically

In above image I have declared few variables contains basic integer, string and floating point values and performed vary basic mathematical operation addition. this is very simple example of assigning value to variable in Python Programming. The most interesting thing which personally I like about Python Language is you don’t need to tell python about data type of variable while assigning value to it(no need to declare type of variable) and another one reason is unlike other programming language Python Doesn’t require to put semicolon (;) at the end of the line.

Conclusion

if you have come to read till here then congratulations you have one step closer to Learning Python Programming. I have explained very basic knowledge about data types in Python. these are the primary data types in Python. Understanding their characteristics and usage is essential for effective programming and data manipulation in Python. In Next blog I will explain data types their declaration and how to use those data types in detail.

--

--

Sayali Kumbhar

Python Enthusiast 🐍 | Machine Learning Enthusiast | Data Science Enthusiast