Python pow() Function26 Sept 2024 | 1 min read Python pow() function is used to compute the powers of a number. It returns x to the power of y modulus z if a third argument(z) is present, i.e. (x, y) % z. SignatureParametersx: It is a number, a base y: It is a number, an exponent. z (optional): It is a number and the modulus. ReturnIt returns x to the power of y modulus z, if a third argument(z) is given, i.e. (x, y) % z. Python pow() Function Example 1:The below example shows the working of pow(). Output: 16 16 0.0625 0.0625 Explanation: In the above example, we have taken different values of the argument (x,y) and returns x to the power of y. Python pow() Function Example 2:The below example shows pow() with three arguments (x, y, z) Output: 1 Next TopicPython Built in Functions |
Function function is used to get help related to the object passed during the call. It takes an optional parameter and returns help information. If no argument is given, it shows the Python help console. It internally calls python's help function. Signature help(object) Parameters object: It can be any...
2 min read
Python () Function Python () function is used to fetch item from the collection. It takes two arguments an iterator and a default value and returns an element. This method calls on iterator and throws an error if no item is present. To avoid the error,...
2 min read
Function function is used to create a tuple object. Signature tuple(iterable) Parameters Iterable: It is a sequence, collection, or an iterator object. Return It returns a tuple. Function Example 1 The below example creates tuple using tuple(). t1 = tuple() print('t1=', t1) # creating a tuple from a list t2 = tuple([1, 6, 9]) print('t2=',...
1 min read
Function The python list() creates a list in python. Signature list(iterable) Parameters iterable (optional) - An object that can be a sequence( string, tuple etc.) or collection( set, dictionary etc.) or iterator object. Return It returns a list. Function Example 1 The below example create a list from sequence: string, tuple and list. #...
1 min read
Function The python getattr() function returns the value of a named attribute of an object. If it is not found, it returns the default value. Signature getattr(object, attribute, default) Parameters object: An object whose named attribute value is to be returned. attribute: Name of the attribute of which you want to...
1 min read
Function The python ascii() function returns a string containing a printable representation of an object and escapes the non-ASCII characters in the string using \x, \u or \U escapes. Signature ascii(object) Parameters object: It takes an object like strings, list etc. Return It returns a readable version of an object and replaces...
1 min read
Function function returns the list of names in the current local scope. If the object on which method is called has a method named __dir__(), this method will be called and must return the list of attributes. It takes a single object type argument....
2 min read
Function Python is a strong and flexible programming language that offers different built-in functions to perform operations on data. One such function is the map() function, which is utilized to apply a function to each element of an iterable (like a list or a tuple) and...
3 min read
Function function is used to get an octal value of an integer number. This method takes an argument and returns an integer converted into an octal string. It throws an error TypeError if argument type is other than an integer. The signature of oct() function is...
1 min read
Function The python exec() function is used for the dynamic execution of Python program which can either be a string or object code and it accepts large blocks of code, unlike the eval() function which only accepts a single expression. Signature exec(object, globals, locals) Parameters object - It should be...
1 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India