Python Type()

Python type()

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.…
View Post
Python Slice()

Python slice()

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…
View Post
Python Dir()

Python dir()

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 …
View Post
Python Enumerate()

Python enumerate()

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…
View Post
Python Complex()

Python complex()

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…
View Post
Python Callable()

Python callable()

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()…
View Post
Python Bytearray()

Python bytearray()

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…
View Post
Python Bytes()

Python bytes()

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…
View Post
Python Divmod()

Python divmod()

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()…
View Post
Python Bool()

Python bool()

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()…
View Post
Python Bin()

Python bin()

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…
View Post
Python Ascii()

Python ascii()

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…
View Post
Python All()

Python all()

 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…
View Post
Python Any()

Python any()

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…
View Post
Python Abs()

Python abs()

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…
View Post

XOR in Python

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…
View Post