Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Syntax: Types of Functions

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

A function is a group of related statements that performs a

specific task.
Functions help break our program into smaller segments .
As our program grows larger and larger, functions make it
more organized and manageable.
SYNTAX
def functionname( parameters ):
"function_docstring"
function_suite
return [expression]
EXAMPLE
def printme( str ):
"This prints a passed string into this function"
print str
return
Types of Functions

Basically, we can divide functions into the following two


types:

1. Built-in functions - Functions that are built into Python.


2. User-defined functions - Functions defined by the users
themselves.

You might also like