Finding The DataType In Python

Introduction

In this blog, I will explain how to find the datatype in Python. It will clearly display in the run module which type of the datatype appears in the program.

Software Requirement

Python2.7.11

Programming
  1. print("Welcome To C#Corner.....")   
  2. print("Finding Datatype :")   
  3. print(type(21))   
  4. print(type(21111111111111))   
  5. print(type(21.23))   
  6. print(type("C#corner"))   
  7. print(type('j'))   
  8. print(type(12j+2))   
Explanation

Let us see the difference in the datatype.
  1. print("Welcome To C#Corner.....")   
  2. print("Finding Datatype :")   
  3. print(type(21))   
In this code, I have to type the data as 21. Now, it will display in the run Window, i.e. which type of the data type is seen in the output.

Output 1

Output
  1. print("Welcome To C#Corner.....")   
  2. print("Finding Datatype :")   
  3. print(type(21))   
  4. print(type(21111111111111))   
In this code, I have to type the data as 21111111111111111. Now, it will be displayed in the run Window; i.e. which type of the data type is seen in the output.

Output 2

Output
  1. print("Welcome To C#Corner.....")   
  2. print("Finding Datatype :")   
  3. print(type(21))   
  4. print(type(21111111111111))   
  5. print(type(21.23))   
In this code, I have to type the data as 21.23. Now, it will be displayed in the Window i.e. which type of the data type is seen in the output.

Output3

Output
  1. print("Welcome To C#Corner.....")   
  2. print("Finding Datatype :")   
  3. print(type(21))   
  4. print(type(21111111111111))   
  5. print(type(21.23))   
  6. print(type("C#corner"))   
  7. print(type("j"))   
In this code, I have to type the data as C#Corner. Now, it will be displayed in the Window i.e. which type of the datatype is seen in the output.

Output

Final Output

Output