Class 11 Python – Summary of Functions and
Methods
1. Dictionary Manipulation Functions and Methods
[Link] Function / Method Description
1 len(D) Returns number of items in dictionary.
2 [Link](key, default) Returns value of key; if not found returns default.
3 [Link]() Returns sequence of (key, value) pairs.
4 [Link]() Returns list of keys.
5 [Link]() Returns list of values.
6 [Link](seq, value) Creates new dictionary with given keys and common value.
7 [Link](key, value) Inserts key with value if not present.
8 [Link](other_dict) Merges another dictionary into D.
9 [Link]() Creates shallow copy of dictionary.
10 [Link](key) Removes and returns value of given key.
11 [Link]() Removes and returns last (key, value) pair.
12 [Link]() Removes all items from dictionary.
13 sorted(dict, reverse=False) Returns sorted list of dictionary keys.
14 min(dict), max(dict), sum(dict) Returns min key, max key or sum of keys.
2. Difference Between sort() and sorted()
sort() Method sorted() Function
Modifies original list (in-place). Creates new sorted list.
Works only on lists. Works on any iterable (list, tuple, etc.).
Returns None. Returns new sorted list.
3. List Manipulation Functions and Methods
[Link] Function / Method Description
1 len(list) Returns length of list.
2 list(seq) Creates list from sequence.
[Link] Function / Method Description
3 [Link](item) Returns index of first occurrence.
4 [Link](item) Adds item at end.
5 [Link](list2) Adds multiple elements.
6 [Link](pos, item) Inserts item at position.
7 [Link](index) Removes and returns item at index.
8 [Link](value) Removes first occurrence of value.
9 [Link]() Removes all elements.
10 [Link](item) Counts occurrences of item.
11 [Link]() Reverses list in-place.
12 [Link]() Sorts list in ascending order.
13 sorted(iterable, reverse=False) Returns new sorted list.
14 min(list), max(list), sum(list) Returns minimum, maximum, sum.
4. Tuple Manipulation Functions and Methods
[Link] Function / Method Description
1 len(tuple) Returns length of tuple.
2 max(tuple) Returns maximum value.
3 min(tuple) Returns minimum value.
4 sum(tuple) Returns sum of elements.
5 [Link](item) Returns index of element.
6 [Link](item) Counts occurrences of item.
7 sorted(tuple) Returns sorted list from tuple.
8 tuple(seq) Creates tuple from sequence.
5. String Manipulation Functions and Methods
[Link] Function / Method Description
1 len(string) Returns length of string.
2 [Link]() Capitalizes first character.
3 [Link](sub) Counts occurrences of substring.
4 [Link](sub) Returns lowest index of substring.
5 [Link](sub) Returns index or error if not found.
6 [Link]() True if alphanumeric.
[Link] Function / Method Description
7 [Link]() True if alphabetic.
8 [Link]() True if digits.
9 [Link]() True if lowercase.
10 [Link]() True if uppercase.
11 [Link]() True if whitespace.
12 [Link]() Converts to lowercase.
13 [Link]() Converts to uppercase.
14 [Link]() Removes leading & trailing spaces.
15 [Link](sub) True if starts with sub.
16 [Link](sub) True if ends with sub.
17 [Link]() Title case string.
18 [Link](old,new) Replaces substring.
19 [Link](sep) Splits string into list.
20 [Link](iterable) Joins iterable into string.
21 [Link](sep) Splits into 3 parts at separator.