Functions
A function is a block of organized, reusable code that is used to perform a single, related action. Functions provide better modularity for your application and a high degree of code reusing.
def functionname( parameters ):
"function_docstring"
function_suite
return [expression]
#!/usr/bin/python3
# Function definition is here
def printme( str ):
"keen infotect"
print (str)
return
# Now you can call printme function
printme()
def functionname( parameters ):
"function_docstring"
function_suite
return [expression]
#!/usr/bin/python3
# Function definition is here
def printme( str ):
"keen infotect"
print (str)
return
# Now you can call printme function
printme()
Comments
Post a Comment