Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Tuples as return values

def f(r):
    """ Return (circumference, area) of a circle of radius r """
    c = 2 * math.pi * r
    a = math.pi * r * r
    return (c, a)
Source by openbookproject.net #
 
PREVIOUS NEXT
Tagged: #Tuples #return #values
ADD COMMENT
Topic
Name
8+4 =