0% found this document useful (0 votes)
1 views10 pages

4 Data Types Numbers Python

The document discusses three main data types in Python: Integers, Floats, and Complex Numbers. It explains that integers can be positive or negative and supports basic arithmetic operations, while floats are decimal numbers useful for precise calculations. Complex numbers consist of a real and imaginary part, represented in Python with 'j', and also support standard arithmetic operations.

Uploaded by

Vidyashankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views10 pages

4 Data Types Numbers Python

The document discusses three main data types in Python: Integers, Floats, and Complex Numbers. It explains that integers can be positive or negative and supports basic arithmetic operations, while floats are decimal numbers useful for precise calculations. Complex numbers consist of a real and imaginary part, represented in Python with 'j', and also support standard arithmetic operations.

Uploaded by

Vidyashankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Data Types – Numbers

- Integers, Floats, Complex

- V VIDYASHANKAR
- 6 T H JULY 2O25
Integers
 Numbers are often used in programming to keep score in games, represent data
visualizations,

store information in web applications

 The usual operations of addition ( + ), subtraction ( - ), multiplication ( * ) and


division ( / ) are

possible in Python

 Integers can be positive or negative


Example
Example
Float
 A float or a floating point number is positive, or negative containing a decimal
point

 All the usual operations that are applicable to integers are applicable to floats as
well

 Float is useful in mathematical programs where precision in numerical


calculation becomes

important
Example
Example
Complex Numbers
 A complex number has a real part and imaginary part

 In mathematical terms, it is written as a + i b where a is the real part and b is the


imaginary part

For example : 3 + 4 i

 In Python, a complex number is represented by 3 + 4 j

The usual operations of addition, subtraction, multiplication and division can be performed
on

Complex Numbers
Example
Do-it-yourself
Check if Python accepts i as an imaginary number

Look at exploring possible combinations : Integer + float, Float – Integer, Integer / Float, Float / Integer

And Integer * Float and Float * Integer

You might also like