0% found this document useful (0 votes)
54 views1 page

Syntax: Types of Functions

A function is a group of related statements that performs a specific task and helps break programs into smaller, more organized and manageable segments as the program grows larger. Functions have a defined syntax including the def keyword, function name, parameters, docstring, function suite, and optional return statement. There are two types of functions: built-in functions that are included in Python and user-defined functions that are created by users.

Uploaded by

rakesh kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views1 page

Syntax: Types of Functions

A function is a group of related statements that performs a specific task and helps break programs into smaller, more organized and manageable segments as the program grows larger. Functions have a defined syntax including the def keyword, function name, parameters, docstring, function suite, and optional return statement. There are two types of functions: built-in functions that are included in Python and user-defined functions that are created by users.

Uploaded by

rakesh kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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