Python Functions, Packing, and Unpacking Packing and Unpacking Packing Challenge

Adriana Alvear
Adriana Alvear
1,266 Points

What does it mean the word 'pass' in the packing.py challenge?

What does it mean the word 'pass' in the packing.py challenge?

packing.py
def packer(param1, param2, param3):
    pass

packer('Functions', 'are', 'fun!')

2 Answers

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 49,589 Points

From the docs

pass is a null operation -- when it is executed, nothing happens. It is useful as a placeholder when a statement is required syntactically, but no code needs to be executed

In the code you posted, without it packer('Functions', 'are', 'fun!') causes an indentation error because Python would think the line is meant to be part of the function.