Q. Describe the different styles of functions in Python using appropriate examples.
Answer :-
1. Built-in functions :- These are pre-defined functions and are always available for use.
For example :-
len(), type(), int(), input() etc.
2. Functions defined in modules :- These functions are pre-defined in particular modules and can only be used when the corresponding module is imported.
For example :- if you to use pre-defined functions inside a module, say sin(), you need to first import the module math (that contains definition of sin() ) in your program.
3. User defined functions :- These are defined by the programmer. As programmers you can create your own functions.
For example :-
len(), type(), int(), input() etc.
2. Functions defined in modules :- These functions are pre-defined in particular modules and can only be used when the corresponding module is imported.
For example :- if you to use pre-defined functions inside a module, say sin(), you need to first import the module math (that contains definition of sin() ) in your program.
3. User defined functions :- These are defined by the programmer. As programmers you can create your own functions.
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )