Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how do you write a function in python

def functionName():
    # What to make the function do

# Basic Example
def addNum(num1, num2):
    print(num1 + num2)

# To call this function
addNum(2, 4)

# Output: 6
 
PREVIOUS NEXT
Tagged: #write #function #python
ADD COMMENT
Topic
Name
5+7 =