Skip to content

Latest commit

 

History

History
13 lines (12 loc) · 454 Bytes

File metadata and controls

13 lines (12 loc) · 454 Bytes

Data types in Python

- In python there is a function to check the data type of a variable - type()

var_1 = 3;

print(type(var_1)) => output -> <class 'int'>

These int,float,char are data types and they are classes

so var_1 is the instance of that classes

-------------------------------------------

var_1 = 123

var_2 = 10.1

print(type(var_1 + var_2))

this will print <class 'float'>

--------------------------------------------