This page is meant to be a quick reference guide to Python. If you see something that needs to be added, please let us know and we will add it to the list.
The default Python prompt of the interactive shell. Often seen for code examples which can be executed interactively in the interpreter.
Return the absolute value of a number.
Extra information which the computer uses to perform commands.
Argparse is a parser for command-line options, arguments and subcommands.
Used during debugging to check for conditions that ought to apply
Giving a value to a variable.
Section of code which is grouped together
break Used to exit a for loop or a while loop.
A template for creating user-defined objects.
Translates a program written in a high-level language into a low-level language.
continue Used to skip the current block, and return to the “for” or “while” statement
Statement that contains an “if” or “if/else”.
The process of finding and removing programming errors.
Defines a function or method
A mutable associative array (or dictionary) of key and value pairs. Can contain mixed types (keys and values). Keys must be a hashable type.
Package included in the Python Standard Library for installing, building and distributing Python code.
A docstring is a string literal that occurs as the first statement in a module, function, class, or method definition.
A pseudo-module which programmers can use to enable new language features which are not compatible with the current interpreter.
Easy Install is a python module (easy_install) bundled with setuptools that lets you automatically download, build, install, and manage Python packages.
Python evaluates expressions from left to right. Notice that while evaluating an assignment, the right-hand side is evaluated before the left-hand side.
Means of breaking out of the normal flow of control of a code block in order to handle errors or other exceptional conditions
Python code that produces a value.
filter(function, sequence) returns a sequence consisting of those items from the sequence for which function(item) is true
An immutable floating point number.
Iterates over an iterable object, capturing each element to a local variable for use by the attached block
A parameterized sequence of statements.
An invocation of the function with arguments.
The process of freeing memory when it is not used anymore.
A function which returns an iterator.
high level language
Designed to be easy for humans to read and write.
Integrated development environment
Conditionally executes a block of code, along with else and elif (a contraction of else-if).
Cannot be changed after its created.
Used to import modules whose functions or variables can be used in the current program.
Python uses white-space indentation, rather than curly braces or keywords, to delimit blocks.
An immutable integer of unlimited magnitude.
When commands are read from a tty, the interpreter is said to be in interactive mode.
Execute a program by translating it one line at a time.
Interactive shell for interactive computing.
Related: iPython tutorial
An object capable of returning its members one at a time.
They are a shorthand to create anonymous functions.
Mutable list, can contain mixed types.
A compact way to process all or part of the elements in a sequence and return a list with the results.
Literals are notations for constant values of some built-in types.
map(function, iterable, …) Apply function to every item of iterable and return a list of the results.
A method is like a function, but it runs “on” an object.
The basic unit of code reusability in Python. A block of code imported by some other code.
Any data with state (attributes or value) and defined behavior (methods).
allows users to manipulate data structures called objects in order to build and execute programs.
Needed to create an empty code block
A set of recommendations how to write Python code.
Python Package Index
Official repository of third-party software for Python
An idea or piece of code which closely follows the most common idioms of the Python language, rather than implementing code using concepts common to other languages.
reduce(function, sequence) returns a single value constructed by calling the (binary) function on the first two items of the sequence, then on the result and the next item, and so on.
Unordered set, contains no duplicates
Collection of enhancements to the Python distutils that allow you to more easily build and distribute Python packages
Sub parts of sequences
A character string: an immutable sequence of Unicode codepoints.
Can include numbers, letters, and various symbols and be enclosed by either double or single quotes, although single quotes are more commonly used.
A statement is part of a suite (a “block” of code).
Allows exceptions raised in its attached code block to be caught and handled by except clauses.
Immutable, can contain mixed types.
Placeholder for texts and numbers. The equal sign (=) is used to assign values to variables.
Executes a block of code as long as its condition is true.
Encloses a code block within a context manager.
Returns a value from a generator function.
Zen of Python
When you type “import this”, Python’s philosophy is printed out.
Recommended Python Training
Course: Python 3 For Beginners
Over 15 hours of video content with guided instruction for beginners. Learn how to create real world applications and master the basics.