Online Mind Mapping and Brainstorming

Create your own awesome maps

Online Mind Mapping and Brainstorming

Even on the go

with our free apps for iPhone, iPad and Android

Get Started

Already have an account? Log In

Pythonic Programming by Mind Map: Pythonic Programming
5.0 stars - 2 reviews range from 0 to 5

Pythonic Programming

Syntax

use parenthesis for long-line wrapping

use r"C:\temp.txt" for raw strings

use "".join(list) to join a list of strings

use collections.defaultdict() to create dictionaries with default factory functions

use locals() for named string formatting

Use a list comprehension when a computed list is the desired end result.

Use a generator expression when the computed list is just an intermediate step.

use lists instead of concatenating strings using the "+=" operator.

Links

Code Like a Pythonista

Idioms and Anti-Idioms in Python

Python Idioms and Efficiency Suggestions