#### World's Best AI Learning Platform **with profoundly Demanding** Certification Programs

Designed by IITians, only for AI Learners.

Internship Partner

In Association with

In collaboration with

Designed by IITians, only for AI Learners.

Internship Partner

In Association with

In collaboration with

New to InsideAIML? Create an account

Employer? Create an account

Designed by IITians, only for AI Learners.

Internship Partner

In Association with

In collaboration with

Enter your email below and we will send a message to reset your password

Designed by IITians, only for AI Learners.

Internship Partner

In Association with

In collaboration with

By providing your contact details, you agree to our Terms of Use & Privacy Policy.

Already have an account? Sign In

Designed by IITians, only for AI Learners.

Internship Partner

In Association with

In collaboration with

By providing your contact details, you agree to our Terms of Use & Privacy Policy.

Already have an account? Sign In

Download our e-book of Introduction To Python

Matplotlib - Object-oriented InterfaceMatplotlib - MultiplotsCNTK - Creating First Neural NetworkMatplotlib - Working with ImagesMicrosoft Cognitive Toolkit (CNTK) - CPU and GPUPython Forensics - Memory and ForensicsPython Blockchain - Scope and ConclusionDiscuss Microsoft Cognitive ToolkitMatplotlib - Twin AxesMatplotlib - Subplot2grid() Function View More

Exception Type: JSONDecodeError at /update/ Exception Value: Expecting value: line 1 column 1 (char 0) How can I write Python code to change a date string from "mm/dd/yy hh: mm" format to "YYYY-MM-DD HH: mm" format? How to choosing the right estimator for the machine learning problem? How to Write Python ZIP File? How to extracting text from PDF file using python How can a web interface execute a .py file from a PHP file? What methods can we use to differentiate between correlated and uncorrelated variables in a regression analysis? How to leave/exit/deactivate a Python virtualenvironment Join Discussion

4.5 (1,292 Ratings)

589 Learners

Sep 30th (7:00 PM) 1117 Registered

Sanjeev Shah

2 years ago

- Introduction
- Number Type Conversion
- Mathematical Functions
- Random Number Functions
- Trigonometric Functions
- Mathematical Constants

Number data types store numeric values. They are immutable data types. This means, changing the value of a number of data type results in a newly allocated object.

Number objects are created when you assign a value to them. For example −

You can also delete the reference to a number object by using the del statement. The syntax of the del statement is −

You can delete a single object or multiple objects by using the del statement. For example −

Python supports different numerical types −

**int (signed integers)**− They are often called just integers or ints. They are positive or negative whole numbers with no decimal point. Integers in Python 3 are of unlimited size. Python 2 has two integer types - int and long. There is no '**long integer**' in Python 3 anymore.

**float (floating point real values)**− Also called floats, they represent real numbers and are written with a decimal point dividing the integer and the fractional parts. Floats may also be in scientific notation, with E or e indicating the power of 10 (2.5e2 = 2.5 x 102 = 250).

**complex (complex numbers)**− are of the form a + bJ, where a and b are floats and J (or j) represents the square root of -1 (which is an imaginary number). The real part of the number is a, and the imaginary part is b. Complex numbers are not used much in Python programming.

It is possible to represent an integer in hexadecimal or octal form

```
>>> number = 0xA0F #Hexa-decimal
>>> number
2575
>>> number = 0o37 #Octal
>>> number
31
```

Here are some examples of numbers.

A complex number consists of an ordered pair of real floating-point numbers denoted by a &plus bj, where a is the real part and b is the imaginary part of the complex number.

Python converts numbers internally in an expression containing mixed types to a common type for evaluation. Sometimes, you need to coerce a number explicitly from one type to another to satisfy the requirements of an operator or function parameter.

- Type
**int(x)**to convert x to a plain integer.

- Type
**long(x)**to convert x to a long integer.

- Type
**float(x)**to convert x to a floating-point number.

- Type
**complex(x)**to convert x to a complex number with real part x and imaginary part zero.

- Type
**complex(x, y)**to convert x and y to a complex number with real part x and imaginary part y. x and y are numeric expressions

Python includes the following functions that perform mathematical calculations.

Random numbers are used for games, simulations, testing, security, and privacy applications. Python includes the following functions that are commonly used.

Python includes the following functions that perform trigonometric calculations.

The module also defines two mathematical constants −

Enjoyed reading this blog? Then why not share it with others. Help us make this AI community stronger.

To learn more about such concepts related to Artificial Intelligence, visit our insideAIML blog page.

You can also ask direct queries related to Artificial Intelligence, Deep Learning, Data Science and Machine Learning on our live insideAIML discussion forum.

Keep Learning. Keep Growing.