write any two functions used in python
Answers
Answer:
A function is a block of reusable code that is used to perform a specific action. The advantages of using functions are:
Reducing duplication of code
Decomposing complex problems into simpler pieces
Improving clarity of the code
Reuse of code
Information hiding
Functions in Python are first-class citizens. It means that functions have equal status with other objects in Python. Functions can be assigned to variables, stored in collections, or passed as arguments. This brings additional flexibility to the language.
Python function types
There are two basic types of functions: built-in functions and user defined functions. The built-in functions are part of the Python language; for instance dir(), len(), or abs(). The user defined functions are functions created with the def keyword.
Python creating functions
A function is created with the def keyword. The statements in the block of the function must be indented.
def function():
pass
The def keyword is followed by the function name with round brackets and a colon. The indented statements form a body of the function.
The function is later executed when needed. We say that we call the function. If we call a function, the statements inside the function body are executed.
Hope you got the answer
please mark branlist
Answer:
print function and import function are two functions used in python.
please like, follow me and mark me as brainlest.