July 2017
Intermediate to advanced
374 pages
8h
English
A function is a block of organized, self-contained programs that perform a specific task, which you can incorporate into your own larger programs. They are defined as follows:
# function
def functionname():
do something
return
These are a few points to remember:
Please see the following code snippet example, which showcases functions:
def display ( name ):
#This prints a passed string into this function
print ("Hello" + name)
return;
You can call the preceding function as follows:
display("Manish")
display("Mohit")
The following screenshot shows the execution ...
Read now
Unlock full access