The chr() function in Python is a built-in function that returns a string representing a character whose Unicode code point is the given integer. It is essentially the inverse of the ord() function, which returns the Unicode code point of a...
Dir function The dir() function without argument return the list of names in the current local scope. The dir(object) function with argument return a list of valid attributes for the given object. Examples Example 1 >>> dir() ['__builtins__', '__doc__', '__loader__', '__name__',...
Enumerate function The enumerate() function return an enumerate object. The object must be a sequence, a list or an iterator. Examples Example 1 >>> my_list = ['a', 'b', 'c', 'd', 'e'] >>> list(enumerate(my_list)) [(0, 'a'), (1, 'b'), (2, 'c'), (3, 'd'),...
Eval function The eval() function evaluates an expression and returns the value of expression. The return value can be number or string. Examples Example 1 >>> a = 2 >>> b = 3 >>> eval('a + b') 5 >>> eval('a +...
Hash function The hash(object) function return an integer value of the object. The returned values are used to compare dictionary keys during a dictionary search. Examples Example 1 >>> x = 2 >>> hash(x) 2 >>> y = -3 >>> hash(y)...