Expanded List of Additional Built-In Functions
Expanded List of Additional Built-In Functions
Python.
vars() : Returns __dict__ attribute for a module, class, instance, or any other object with
attributes.
5. Memory-related Functions:
memoryview() : Creates a view object that exposes a buffer's data.
8. Utility Functions:
slice() : Returns a slice object.
endswith() : Returns True if the string ends with the specified value.
strip() : Removes leading and trailing spaces (or other specified characters).
islower() : Returns True if all alphabetic characters in the string are lowercase.
isupper() : Returns True if all alphabetic characters in the string are uppercase.
partition() : Splits the string at the first occurrence of the separator and returns a tuple.
rpartition() : Splits the string at the last occurrence of the separator and returns a tuple.
setdefault() : Returns the value of the specified key. If the key does not exist, inserts the key with
the specified value.
difference_update() : Removes all elements of another set from the original set.
symmetric_difference() : Returns the symmetric difference of two sets (elements that are in
either set, but not both).
@classmethod : Used to define class methods that take the class as the first parameter.
2. Context Managers:
with : Used for wrapping the execution of a block of code in methods defined by context
managers (e.g., file operations).
3. Custom Exceptions:
You can define custom exceptions by subclassing Python’s built-in Exception class:
4. Comprehensions:
List comprehensions:
python Copy code
Dictionary comprehensions:
python Copy code
Set comprehensions:
python Copy code
5. Generators:
Used to create iterators with a sequence of values. A generator yields values using
the yield keyword.