Python functions and methods Quick Revision

Data Analytics
Mr. Plan ₿ Publication
2 min readAug 3, 2024

--

### STRING FUNCTIONS:
- len(): Returns the length of a string.
- str.upper(): Converts a string to upper-case.
- str.lower(): Converts a string to lower-case.
- str.capitalize(): Capitalizes the first character of a string.
- str.split(): Splits a string into a list.
- str.join(): Joins elements of a list into a string.
- str.replace(): Replaces a specified phrase with another specified phrase.
- str.strip(): Removes whitespace from the beginning and end of a string.

### LIST FUNCTIONS:
- len(): Returns the length of a list.
- list.append(): Adds an item to the end of the list.
- list.extend(): Adds the elements of a list (or any iterable) to the end of the current list.
- list.insert(): Adds an item at a specified position.
- list.remove(): Removes the first item with the specified value.
- list.pop(): Removes the item at the specified position.
- list.index(): Returns the index of the first element with the specified value.
- list.sort(): Sorts the list.
- list.reverse(): Reverses the order of the list.

--

--

Data Analytics
Mr. Plan ₿ Publication

Data Science, SQL, Excel, Python, Power BI, Tableau & Machine Learning Best Resources: heylink.me/DataAnalytics