Define two types of functions with example in Python.
Answers
Answer:
There are three types of functions in Python: Built-in functions, such as help() to ask for help, min() to get the minimum value, print() to print an object to the terminal,… ... User-Defined Functions (UDFs), which are functions that users create to help them out;
hope this helps you out
Explanation:
There are three types of functions in Python:
Built-in functions, such as help() to ask for help, min() to get the minimum value, print() to print an object to the terminal,… You can find an overview with more of these functions here.
User-Defined Functions (UDFs), which are functions that users create to help them out; And
Anonymous functions, which are also called lambda functions because they are not declared with the standard def keyword.
Example of a function:
def greet(name):
"""
This function greets to
the person passed in as
a parameter
"""
print("Hello, " + name + ". Good morning!")
Hope this helps you