Python_BuiltIn_Functions_Alphabetical
Python_BuiltIn_Functions_Alphabetical
abs()
Example:
abs(-7) -> 7
all()
Example:
any()
Example:
ascii()
Example:
bin()
Example:
bool()
Example:
breakpoint()
Example:
breakpoint()
bytearray()
Example:
bytes()
Example:
callable()
Example:
chr()
Example:
classmethod()
compile()
Example:
complex()
Example:
delattr()
Example:
delattr(obj, 'attr')
dict()
Creates a dictionary.
Example:
dict(a=1, b=2)
dir()
Example:
dir([])
divmod()
Example:
enumerate()
Example:
enumerate(['a','b'])
eval()
Example:
eval('2+2') -> 4
exec()
Example:
exec('x=5')
filter()
Example:
float()
Example:
float('3.14')
format()
Formats a string.
Example:
frozenset()
Example:
frozenset([1, 2, 3])
getattr()
Example:
getattr(obj, 'attr')
globals()
hasattr()
Example:
hasattr(obj, 'attr')
hash()
Example:
hash('abc')
help()
Example:
help(str)
hex()
Python Built-in Functions Explained
Example:
id()
Example:
id(42)
input()
Example:
input('Enter: ')
int()
Example:
int('5')
isinstance()
Example:
isinstance(5, int)
issubclass()
Example:
issubclass(bool, int)
Python Built-in Functions Explained
iter()
Returns an iterator.
Example:
iter([1, 2])
len()
Returns length.
Example:
len('abc') -> 3
list()
Creates a list.
Example:
locals()
map()
Example:
max()
Example:
memoryview()
Python Built-in Functions Explained
min()
Example:
next()
Example:
next(iter([1, 2]))
object()
oct()
Example:
open()
Opens a file.
Example:
open('file.txt', 'r')
ord()
Example:
ord('A') -> 65
Python Built-in Functions Explained
pow()
Power function.
Example:
pow(2, 3) -> 8
print()
Prints to stdout.
Example:
print('Hello')
property()
range()
Example:
repr()
Example:
reversed()
Example:
reversed([1, 2, 3])
round()
Python Built-in Functions Explained
Rounds a number.
Example:
set()
Creates a set.
Example:
setattr()
Example:
slice()
Example:
slice(1, 5)
sorted()
Example:
sorted([3, 1, 2])
staticmethod()
str()
Converts to string.
Python Built-in Functions Explained
Example:
sum()
Example:
super()
Example:
super().method()
tuple()
Creates a tuple.
Example:
tuple([1, 2])
type()
Example:
vars()
zip()
Combines iterables.
Example:
Python Built-in Functions Explained
__import__()
Example:
__import__('math')