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

Python Data Structures Overview

The document provides an overview of basic data structures in Python, including strings, lists, sets, tuples, and dictionaries. It outlines their characteristics, common methods, and operations, emphasizing their mutability and immutability. Each section details how to manipulate these data structures effectively in Python programming.

Uploaded by

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

Python Data Structures Overview

The document provides an overview of basic data structures in Python, including strings, lists, sets, tuples, and dictionaries. It outlines their characteristics, common methods, and operations, emphasizing their mutability and immutability. Each section details how to manipulate these data structures effectively in Python programming.

Uploaded by

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

Advance Python Programming - Unit 1 Notes

1.1 Use of String and List operations in Python Programs

String:

- A string is a sequence of characters enclosed in quotes.

- Strings are immutable.

- Common methods: upper(), lower(), replace(), strip(), split(), find()

List:

- A list is an ordered, mutable collection of items.

- Lists can contain elements of different types.

- Common methods: append(), insert(), remove(), pop(), sort(), reverse(), count(), index()

1.2 Use built-in functions for Set manipulation

Set:

- A set is an unordered collection of unique items.

- Sets are mutable but cannot contain mutable items like lists.

- Common methods: add(), remove(), discard(), pop(), clear(), update()

- Set operations: union(), intersection(), difference(), symmetric_difference()

1.3 Use of Tuple operations in Python programs

Tuple:

- A tuple is an ordered, immutable collection of items.

- Tuples are defined using parentheses ().

- Access using index and slicing.

- Common methods: count(), index()

- Tuples can be iterated using loops.


Advance Python Programming - Unit 1 Notes

1.4 Use built-in functions for Dictionary manipulation

Dictionary:

- A dictionary stores data in key-value pairs.

- Keys must be unique and immutable.

- Dictionaries are mutable.

- Common methods: keys(), values(), items(), get(), pop(), update(), clear()

- Access items using key: my_dict['key']

- Add/Update: my_dict['new_key'] = value

You might also like