0% found this document useful (0 votes)
2 views2 pages

Understanding Python Data Types

The document provides an overview of data types in Python, categorizing them into numeric, sequence, boolean, and set types. Numeric data types include integers, floats, and complex numbers, while sequence types encompass strings, lists, and tuples. Additionally, it describes boolean values as either True or False and highlights that sets are unordered collections without duplicate elements.

Uploaded by

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

Understanding Python Data Types

The document provides an overview of data types in Python, categorizing them into numeric, sequence, boolean, and set types. Numeric data types include integers, floats, and complex numbers, while sequence types encompass strings, lists, and tuples. Additionally, it describes boolean values as either True or False and highlights that sets are unordered collections without duplicate elements.

Uploaded by

anandthi1219
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

DATA TYPES

Data types are the classification or categorization of data items. Data types are used to identify the type of data and
set of valid operations which can be performed on it.
Python Data Types
Numeric Data Types
The numeric data type in Python represents the data that has a numeric value. A numeric value can be an integer, a
floating number, or even a complex number. These values are defined as Python
int, Python float, and Python complex classes in Python.
Integers – This value is represented by int class. It contains positive or negative whole numbers (without
fractions or decimals). In Python, there is no limit to how long an integer value can be.
Float – This value is represented by the float class. It is a real number with a floating-point
representation. It is specified by a decimal point. Optionally, the character e or E followed by a positive or negative
integer may be appended to specify scientific notation.
Complex Numbers – A complex number is represented by a complex class. It is specified as (real part) +
(imaginary part)j. For example – 2+3j
Sequence Data Type
The sequence Data Type in Python is the ordered collection of similar or different data types. Sequences allow storing
of multiple values in an organized and efficient fashion. There are several sequence types in Python –
String: Strings in Python are arrays of bytes representing Unicode characters
List: Lists are just like arrays, declared in other language which is an ordered collection of data.
Tuple:A tuple is also an ordered collection of Python objects.
Boolean Data Type
Data type with one of the two built-in values, True or False. Boolean objects that are equal to True are truthy (true),
and those equal to False are falsy (false)
Set Data Type
In Python, a Set is an unordered collection of data types that is iterable, mutable, and has no
Duplicate element

You might also like