Function is a collection of statements which is made to perform a specific task.
To Execute function, we have to call it in the program.
Instead of writing a large program we can write small functions as a specific part of program to accomplish the task.
Once written a function can also be used in other programs as library functions.
Functions can be categorized in three types
Built In Functions
Functions in Modules
User Defined Functions
These are the functions which are predefined in python we have to just call them to use.
Functions make any programming language efficient and provide a structure to language.
Python has many built-in functions which makes programming easy, fast and efficient.
They always reside in standard library and we need not to import any module to use them.
These are the functions which converts the values from one type to another:
int() - converts string to integer
str() - converts any value to string
float() - converts string to float
This function is used to take input from user in the form of string.
This function is used to evaluate the value of a string.
This function returns the smallest value among given list of values.
This function returns the biggest value among given list of values.
This function returns the absolute value of any integer which is always positive.
This function is used to identify the type of any value or variable.
This function returns the length of given string.
This function returns the rounded number of given number up to given position.
If you want the series between two numbers then you can use this function. This is useful tool for loop. Its syntax is