Skip to content

Latest commit

 

History

History
23 lines (22 loc) · 838 Bytes

File metadata and controls

23 lines (22 loc) · 838 Bytes

Functions

Function definition: Types are implied.

def identity(x):
    """This is a docstring.
    
    Docstrings are multiline comments appearing at the first line of a function body.
    They are used by the __doc__ attribute. They usually follow this format, with a brief description
    on the very first line, followed by a space, then a longer description, with the closing
    quotes indented on their own line. They are optional, but highly recommended.
    """
    return x # Return statements are the same as always
def make_tuple(x, y):
    """This function returns a tuple containing x and y."""
    return x, y

Next

higher order functions
variadics
more syntax in functions
control structures