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

Updated Data Analytics

Uploaded by

nishanth
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)
1 views2 pages

Updated Data Analytics

Uploaded by

nishanth
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
You are on page 1/ 2

*📦 Python Data Structures* 🐍

1️⃣ *List* – *Ordered, mutable, allows duplicates*


➡️Used to store multiple items in a single variable.
```python
fruits = ["apple", "banana", "mango"]
```

🛠 Methods: `append()`, `insert()`, `pop()`, `remove()`, `sort()`,


`reverse()`

2️⃣ *Tuple* – *Ordered, immutable, allows duplicates*


➡️Like lists, but you can’t modify them.
```python
coordinates = (10, 20)
```

🛠 Supports indexing and slicing, but no item changes.

3️⃣ *Set* – *Unordered, mutable, no duplicates*


➡️Useful for membership testing and removing duplicates.
```python
unique_nums = {1, 2, 3}
```

🛠 Methods: `add()`, `remove()`, `union()`, `intersection()`,


`difference()`
4️⃣ *Dictionary* – *Key-value pairs, unordered (Python 3.6+
keeps order)*
➡️Great for mapping data.
```python
student = {"name": "Alex", "age": 21}
```

🛠 Methods: `get()`, `keys()`, `values()`, `items()`, `update()`,


`pop()`

5️⃣ *String* – *Immutable sequence of characters*


➡️Technically a data type, but also behaves like a data
structure.
```python
text = "hello world"
```

🛠 Supports slicing, `replace()`, `split()`, `join()`, `find()`, etc.

💬 *Tap ❤️for more!*

You might also like