Python type() is a built-in function that returns the type of the object or returns a new type object when all the three arguments are passed to the type() method.…
The slice() in Python is a built-in function that returns a slice object and slices any sequence such as string, tuple, list, bytes, range. slice() Syntax The syntax of the…
The dir() method is an inbuilt function in Python which returns all the valid list of attributes and methods of any object. (functions, dict, list, string, tuple etc.) dir() Syntax …
The enumerate() in Python is a built-in function that adds a counter as a key to an iterable object (list, tuple, etc.) and returns an enumerating object. enumerate() Syntax The…
Python complex() function takes real, imaginary numbers and strings as input and converts them into a complex number. This method takes two optional parameters (real and imaginary) and returns a…
The callable() function in Python returns True if the object passed appears to be callable. Otherwise, it returns False. callable() Syntax The syntax of the callable() method is callable(object) callable()…
Python bytearray() function returns a bytearray object that means it converts an object into bytearray objects, which is an array of given bytes. The bytearray() method provides mutable sequence of…
Python bytes() function return an immutable byte-represented object of given size and data. The bytes() method provides immutable(cannot be changed) sequence of objects in the range of 0 <= x…
The divmod() in Python is a built-in function that takes two numbers as input parameters and returns a pair of numbers (a tuple) consisting of their quotient and remainder. divmod()…
Python’s bool() function converts a given value into Boolean(True or False) using the standard truth testing procedure. bool() Syntax The syntax of bool() method is bool([value]) bool() Parameters The bool()…
The bin() is a built-in function in Python that takes an integer and returns the binary equivalent of the integer in string format. If the given input is not an…
The ascii() in Python is a built-in function that returns a printable and readable version of any object such as Strings, Tuples, Lists, etc. The ascii() function will escape the…
The all() function in Python returns True if all the element of an iterable(List, set, dictionary, tuple) is True. If not, it returns False. The all() method returns True if the iterable object is empty. all() Syntax The…
The any() function in Python returns True if any element of an iterable(List, set, dictionary, tuple) is True. If not, it returns False. any() Syntax The syntax of any() method…
The abs() function in Python returns the absolute value of a given number, which means the abs() method removes the negative sign of a number. If the given number is…
The chr() function takes an integer (representing Unicode) as an input argument and returns a string representing a character. Syntax – chr(num) Parameter and Return Value The chr() function can…
In Python ord() function accepts a single unit of character and returns the equivalent Unicode code value of the passed argument. In other words, the ord() function can take a…
XOR Operator in Python is also known as “exclusive or” that compares two binary numbers bitwise if two bits are identical XOR outputs as 0 and when two bits are different then…