My QA Projects

QA Projects I was involded.

View on GitHub

Functions

Python Style guide

The 3 steps of a function

  1. input
  2. transform
  3. Output

you can do two things with functions

# define the function
def do_nothing(parameters):
        # since functions do something, use a verb as function name
    pass

# call the function
do_nothing()

Examples of functions

Programming interface

Calling Functions

Function implementation

Readability counts docstring vs comments [Zen of Python]

docstring describes the function’s external behavior, and the parameters it takes. comments should document internal info about how the code works.

def echo(anything):
    'echo returns its input argument'
    return anything

  back