Show Menu

Functions Cheat Sheet by

functions

Contents

Declare Function
def functi­on_­name():
Declare Function with Params (Optional)
def functi­on_­nam­e(p­ara­meter, ...)
 
def functi­on_­nam­e(d­efa­ult­=value, ...)
Call Function with Params
functi­on_­nam­e(n­ame­=value, ...)
 
functi­on_­nam­e(v­alue, ...)

Lambdas

Declare Lambda
lambda­_name = lambda parameter, ...: parameter does something
Call Lambda
lambda­_na­me(­par­ameter, ...)

Arguments

Declare Keyword
def functi­on_­nam­e(**­kw­args):
Declare Positional
def functi­on_­nam­e(f­_arg, *args):
Call Keyword
functi­on_­nam­e(k­ey=­value)
Call Positional
functi­on_­nam­e(v­alue, values)

Download the Functions Cheat Sheet

1 Page
//media.cheatography.com/storage/thumb/crystinvw_functions.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Essential Python Cheat Sheet
          PHP Cheat Sheet
          C Reference Cheat Sheet

          More Cheat Sheets by crystinvw