Академический Документы
Профессиональный Документы
Культура Документы
Table of Contents
def function_name(parameters):
"""docstring"""
statement(s)
• Python training institute in Chennai
The definition of the definition above is shown in
the following sections.
1. The key word of the TKR is a sign of the beginning of
a leader.
2. Name of activity to identify inappropriately. The name
of the job is the same as Python's writings.
3. A guide (a reason) used for the cost of performance.
They prefer.
4. Time (:) to show the end of the leader.
Python training in Pune
Example of a function:
def greet(name):
"""This function greets to
the person passed in as
parameter"""
print("Hello, " + name + ". Good morning!")
• Python Online Training
How to call a function in python?
>>> greet('Paul')
Hello, Paul. Good morning!
Python tutorials
Docstring:
return [expression_list]
def absolute_value(num):
"""This function returns the absolute
value of the entered number"""
if num >= 0:
return num
else:
return -num
# Output: 2
print(absolute_value(2))
# Output: 4
print(absolute_value(-4))
How Function works in Python?
Scope and Lifetime of variables:
Output:
Value inside function: 10
Value outside function: 20
Types of Functions:
https://www.besanttechnologies.com/training-
courses/python-training-institute-in-chennai