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

Python Data Objects

The document provides an overview of various Python data objects including lists, tuples, dictionaries, sets, and strings. It highlights the characteristics of each data type, such as mutability for lists and immutability for tuples, as well as the unique properties of dictionaries and sets. The document uses memes to illustrate the concepts in a humorous way.

Uploaded by

Ruchi Rewri
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Python Data Objects

The document provides an overview of various Python data objects including lists, tuples, dictionaries, sets, and strings. It highlights the characteristics of each data type, such as mutability for lists and immutability for tuples, as well as the unique properties of dictionaries and sets. The document uses memes to illustrate the concepts in a humorous way.

Uploaded by

Ruchi Rewri
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Understanding

Python Data
Objects With
Memes

Abhi maza
aayega na bhidu KYA BAAT HAI
Lists
List in Python are declared using square brackets [ ]

1) Lists can hold data of any data type as well as any


data object into it.
2) Additionally, they are mutable which basically means,
once a list is declared,
3) You may still add a new element,
4) Delete an existing element
5) and even Replace an existing element

Lists
Whenever we try to
add, delete or replace an
element in a list, the list
be like:
Ye bhi theek hai
Tuple
Tuple in Python are declared using round brackets ( )

1) Tuples are just like lists (can hold data of any data
type or any data object into it) but are immutable.
2) This means, once a tuple has been declared,
3) We can’t Add a new element to it.
4) Neither Delete an existing element.
5) Nor Replace an existing element.

Whenever we try to add, delete or replace an element in a


tuple the list be like:
Tuple Tuple

Isme meri expertise Main nahi krne


nahi hai , Sorry dunga
Dictionaries
Dictionary in Python are declared using curly
brackets { key: value, key: value }
A dictionary can hold data in key-value format

How data is captured in a dictionary?

Kidhar jana hai


Key

Value
Key
Sets
Sets in Python are declared using curly brackets
{ element-1, element-2, element-3 }
A set can hold only unique data points which get
sorted automatically within it.

If sets was our house-help


Hey “sets” can Where are my
you store my That was easy other pair of
socks? socks?

Me Sets
Strings
Strings in Python are declared using inverted
commas " " , ' ', ''' '''
Strings are used to preserve textual,
alphanumeric data but can hold anything in it.
Strings are immutable data objects.

When we talk about String being a Data Object

String
String

String is a data object See , Nobody Cares


A Quick Summary About
All Data Objects
Duplicate Indexing /
Ordered Mutable Elements Slicing
Sets

List

Tuple
Don’t Forget To

SAVE
&
Follow For More

You might also like