Name

return

Examples
def timestwo(dVal):
    return dVal  * 2

t = timestwo(30)
print(t) # 60

def timestwo(dVals):
    return [x * 2 for x in dVals]

t = timestwo([10, 20, 30])
print(t)  # [20, 40, 60]
def draw(): 
    background(204)
    line(0, 0, width, height)
    if mousePressed:
        return  # Break out of draw(), skipping the line statement below
    line(0, height, width, 0)# Executed only if mouse is not pressed
Description
Syntax
def function:
    statements
    return value
Parameters
function
statements
value
Updated on Wed Jan 18 17:32:21 2017.
Creative Commons License