added general syntax of python function definition (#22670)

* added general syntax of python function definition

* Cleanup
This commit is contained in:
Blaze2305
2018-11-21 05:08:56 +05:30
committed by Manish Giri
parent 1b6b3d38c0
commit 74a4b1175e

View File

@ -3,6 +3,16 @@ title: Python Defining Functions
---
<a href='https://docs.python.org/3/tutorial/controlflow.html#defining-functions' target='_blank' rel='nofollow'>Python Docs</a>
### Basic structure of a python function
>>> def function_name(arguments):
... ''' docstring'''
... statement(\s)
### Example
We can create a function that writes the Fibonacci series to an arbitrary boundary:
>>> def fib(n): # write Fibonacci series up to n