0% found this document useful (0 votes)
9 views

PYTHON DATA TYPES

The document outlines the basic data types in Python, including Integer, Float, String, Boolean, List, Tuple, Dictionary, Set, NoneType, Bytes, and Bytearray. Each data type serves distinct purposes for data manipulation and storage, with examples provided for clarity. Understanding these data types is crucial for writing efficient and readable Python code.
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)
9 views

PYTHON DATA TYPES

The document outlines the basic data types in Python, including Integer, Float, String, Boolean, List, Tuple, Dictionary, Set, NoneType, Bytes, and Bytearray. Each data type serves distinct purposes for data manipulation and storage, with examples provided for clarity. Understanding these data types is crucial for writing efficient and readable Python code.
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/ 6

PYTHON DATA TYPES

Python is a programming language which is simple readable


and versatile
• Python interprets the commands given by identifying the set of variables
called datatypes.

Datatype is a classification of variables determining the type of


operations to be done
• There are multiple datatypes used in this programming language.
List of basic data types

Nonetype Tuple
List
Dic
ng tion
Stri ar y

a n Se
oole t
B

By
at
Fl o

te
s

Byt
r
ege

ear
Int

ray
Data types List
Integer(int):- Represents whole numbers without decimals.
Examples 1, 2, -3.
Float (float):- Represents numbers with decimal points or in
exponential form. Example 3.14, -0.25.
String (str):-Represents sequences of characters enclosed in
single (' ') or double (" ") quotes. Example 'hello', "world“.
Boolean (bool):-Represents truth values, either True or
False, used for logical operations and comparisons.
List (list):-Represents ordered collections of items, which can be of
different data types. Lists are mutable, meaning their elements can be
modified. Example: [1, 2, 'hello', True].

Tuple (tuple):-Represents ordered collections of items, similar to lists,


but they are immutable, meaning their elements cannot be modified
after creation. Example: (1, 2, 'hello', True).

Dictionary (dict):-Represents unordered collections of key-value pairs.


Each key is associated with a value, and the keys are unique within the
dictionary. Example: {'name': 'John', 'age': 30, 'city': 'New York'}
Set (set):-Represents unordered collections of unique elements. Sets do
not allow duplicate values. Example: {1, 2, 3, 4}

NoneType (None):-Represents the absence of a value or a null value in


Python.

Bytes (bytes):-Represents sequences of bytes (integers from 0 to 255),


used for binary data. Example: b'hello’.

Bytearray (bytearray):-Represents mutable sequences of bytes, similar


to bytes objects but can be modified.Example: bytearray(b'hello')
Conclusion
• These are the main built-in data types in Python, each serving
different purposes and providing various functionalities for data
manipulation, storage, and processing.
• Understanding and utilizing these data types effectively is essential
for writing efficient and readable Python code whilst saving time too.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy