built-in functions
built-in functions
-----------------
abs(n)
Module: All functions are presents in built-in functions
Purpose: To find out absolute value of the argument
Arguments:1.n required int
Return: integer
all(iterable)
purpose:To find out all items in the iterable are true or not
If the iterable is empty (), return True.
When used on a dictionary, the all() function checks if all the keys are
true, not the values.
Arguments: 1 iterable optional
Return: booian value
any(iterable)
Purpose:to find out any object in the iterable are true or not
If the iterable is empty(), return False
When used on a dictionary, the any() function checks if any keys are
true, not the values.
Arguments: 1.Iterable optional
Return: bool value
ascii(object)
Purpose: to find out the ascii value of the object
Arguments taking: 1. Object required
Return: ascii converted value
bin(n)
Purpose: To convert value into binary form
Argument taking: 1 n int Required
Return: binary representation of an integer.in string value
bool(object)
Purpose: to convert object into boolian value
Argument taken: 1. Object optional
Return: bool value
callable(Object)
Purpose: to check object is callable or not
Argument taken: 1.object required
Return: boolian value
chr(number)
Purpose: returns the character that represents the specified unicode.
Argument taken:1 number required
Return: Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff.
complex(real, imaginary)
Purpose: to Create a complex number from a real part and an optional imaginary
part
Argument taken: 1.real required int, 2, imaginary optional int default 0
Return: complex value
delattr(object, attribute)
Purpose: To delete the specified attribute from the specified object.
Argument taken: 1. Object required, 2. Attribute required
Return: NoneType
dict(keywordargumtnts)
Purpose: to create dictionary object
Arguments taken: keyword arguments optional
Return: dict value
dir(object)
purpose: returns all properties and methods of the specified object, without
the values.
Argument taken: 1.object
Return: List
divmod(dividend, divisor)
Purpose: to calculate divided value and remaining value in form of tuple
Argument taken: 1.dividend required, 2.divisor required
Return: tuple
filter(function, iterable)
Purpose: to filter required specified value from function
Argument taken: 1.function or None (Required), 2. Iterable (required)
Return: filter
float(value)
Purpose: Convert a string or number to a floating point number, if possible
Argument taken:1. Value(must be string of real number(optional)default is 0
Return: float value
frozenset(iterable)
Purpose: Build an immutable unordered collection of unique elements.
Argument taking: iterable optional
Return: frozenset object
globals()
Purpose: To show the dictionary containing the current scope's global
variables.
Argument taken: no any argument
Return: Dictionary
hasattr(object, attribute)
Purpose: the object has an attribute with the given name.
Argument taken:1. Object required, 2.attribute required
Return: bool value
hex()
Purpose:To the hexadecimal representation of an integer.
Argument taken:1.intiger required
Return: string
id(object)
Purpose:to show the identity of an object.
All objects in Python has its own unique id.
The id is assigned to the object when it is created.
The id is the object's memory address, and will be different for each
time you run the program. (except for some object that has a constant unique id,
like integers from -5 to 256)
Argument taken: 1. object required
Return: identity of an object.
input(prompt)
Purpose:to take input from user
Argument taken:1.prompt optional
Return:string
int(value, base)
Purpose: To convert in to integer value
Argument taken: 1.value optional default is 0,2,base optional
Return: integer
isinstance(object,type)
Purpose: To check whether an object is an instance of a class or of a subclass
thereof
Argument taken: 1. Object required, 2. Type required
Return: bool
iter(object, sentinel)
Purpose: Get an iterator from an object. In the first form, the argument must
supply its own iterator, or be a sequence.
In the second form, the callable is called until it returns the
sentinel.
Argument taken: 1.object required, 2. Sentinel optional
len(object)
purpose:To check the number of items in a container.
Argument taken: 1.object required
Return: int
list(iterable)
purpose:To generate list object
Argument taken: 1. Iterable optional
Return: list
locals()
purpose: To check dictionary containing the current scope's local variables.
Argument taken: not taking any argument
Return: dictionary
map(function, iterable)
Purpose: function executes a specified function for each item in an iterable.
The item is sent to the function as a parameter.
Argument taken: 1.function required, 2.iterable required
Return: map
max(iterable)
Purpose: to findout maximum value in iterable
Argument taken: 1.iterable required
Return: value
min(iterable)
purpose: to findout minium value in iterable
Argument taken: 1.iterable required
Return: value
memoryview(object)
Purpose: Create a new memoryview object which references the given object.
Argument taken: 1. byte object or bytearray object required
Return:
next(iterable, default)
Purpose: Return the next item from the iterator. If default is given and the
iterator
is exhausted, it is returned instead of raising StopIteration.
Argument taken: 1.iterable object required, 2.default optional
Return:value
object()
purpose: To create an empty object
you cannot add new properties or methods for this object
Argument taken: no required
Return: object
oct(int)
Purpose : convert a number into octal
Argument required: int number required
Return: string
open()
Purpose: To opens a file, and returns it as a file object.
ord(character)
Purpose: the Unicode code point for a one-character string.
Argument taken: 1.single character stirng required
Return: int
reversed(sequence)
Purpose: to make a reverse iterator over the values of the given sequence.
Argument taken: 1.sequence required
Return : reversed object
round(number, digit)
Purpose:to roundup the digits
Arguments taken: 1.number required 2.digits optional default 0
Return: float or intiger
set(iterable)
Purpose: to create set
Argument taken:1.iterable optional
Return: set