There are three types of numbers in Python: **integer**, **floating numbers,** and **complex numbers**. This article is about “**integers**”. In this article, you will learn what integer is, how we use integers, and how we use integers in different bases such as binary, octal, and hex.

**Prerequisites:**

**Integer:**

Whole numbers without any fractions or any decimals are called integers. It can be negative or positive. -3242 is an integer as well as 3563 or 0. Integers, by python 3, do not have any limits. Integers can be decimal, binary, hex, or any other literals. In the programing and computer world, we use three mostly. Binary decimal and hex.

It is represented as "**int**" in Python. Python is smart so when you write an integer value to a variable it will understand.

Let´s see integers in action.

**Code:**

>>>a = 12

>>>print(type(a))

**Output:**

<class 'int'>

Is same with

**Code:**

>>>a = int(12)

>>>print(type(a))

**Output:**

<class 'int'>

**0b and 0B are used as binary prefix**

**Code:**

>>>a = 0o12

>>>print(a)

>>>print(type(a))

**Output:**

10

<class 'int'>

**0o and 0O are used as Octal prefix**

**Code:**

>>>a = 0o17

>>>print(a)

>>>print(type(a))

**Output:**

15

<class 'int'>

**0x and 0X are used as hex prefix**

**Code:**

>>>a = 0x7aaa

>>>print(a)

>>>print(type(a))

**Output:**

31402

<class 'int'>