Professional Documents
Culture Documents
1. String Methods
● strip(): Removes whitespaces from the start and end. s = ' hello
'.strip()
● split(): Splits a string into a list. words = 'one,two,three'.split(',')
● join(): Joins elements of an iterable. s = '-'.join(['one', 'two',
'three'])
● replace(): Replaces substrings. s = 'hello'.replace('l', 'r')
● upper(): Converts to uppercase. s = 'hello'.upper()
● lower(): Converts to lowercase. s = 'Hello'.lower()
● startswith(): Checks prefix. b = s.startswith('He')
● endswith(): Checks suffix. b = s.endswith('lo')
● find(): Finds substring index. idx = s.find('l')
● isdigit(): Checks if all characters are digits. b = '123'.isdigit()
● isalpha(): Checks if all characters are alphabetic. b = 'abc'.isalpha()
2. List Methods
3. Dictionary Methods
4. Set Methods
6. General Purpose
7. Conversion Functions
8. Mathematical Functions
12. Miscellaneous
18. Comprehensions
20. Serialization