Python Number
Python Number

Python Number

Learn to work with numerical data in Python. Learn numerical data types. Also learn Math module, Decimal, and Fraction modules.

Python offers a wide variety of inbuilt data types to handle different requirements. Each data type comes with built-in methods for performing different operations.

The numeric data in Python is generally in three formats namely Integer, Float, and Complex.

In this article, you will learn the basic numeric data types available in Python, along with the different ways of creating them.

You will also learn the different methods available to carry out the basic operations in them and the Math module and the Python Decimal and Fraction modules in detail.

Table of contents

Integer Number

Float Number

Complex Numbers

Hexadecimal and Octal Numbers

Number Type Conversion

Math Module Methods to work with Numerical Data

Other Python Number Methods

Python Decimal Module

Python Fraction Module

Printing Numbers in different Formats