Mar. 09, 2016

Python - Quick Guide

Python Basics

We have updated our "Python - Quick Guide". You can find it all in this post,
and at the top of the site. 
Please don't forget to subscribe to our twitter feed as well as our RSS feed. 

On the left side, we have a feedback button. We love to hear what you think,
so please use it to let us know if you have any questions, ideas, problems. 

If you like what you read, please take a moment to share it using the buttons

Python - Quick Guide

This page will describe the basics of Python.

Click on the Title(s) to learn more.

You can see what the topics are about under each title.

An overview for beginners

Python Package Manager

Python web application frameworks

Python Checkers / Debugging

Python shell

Python Game

Python CMS

Web Applications

GUI Frameworks

How to setup Python on your computer

Check if Python is installed on the computer

Install Python on Linux, Mac OS X and Windows

Python Interpreter

Python Syntax

Text Editors

How to write Python programs

Download and Install Python

Installing Python

How do I run my code?

Python Shell

Simple Python Script

Python Variables

What is a variable?

How do I use variables?

Lists different variable types


Using the Python Interpreter

What is Python Interpreter?

How can I use Python Interactively?

Python Comments

Describes how comments works in Python

Shorter examples

Python Docstrings

What is a Docstring?

How should a Docstring look like?

How to access the Docstring

Docstring Examples

Keywords in Python

What are keywords?

List of keywords

Keywords Explained

Booleans in Python

What are Booleans?

Boolean Strings

Boolean and logical operators



Comparison operators

Logical operators

Using math in Python


Counting with variables


Counting with a While Loop

Multiplication table Script

Exception Handling in Python

What is an Exception?

Why use Exceptions?

Raising an Exception

Exception Errors

Exception Errors Examples

Set up exception handling blocks

Code Example

Try … except … else clause

Try … finally clause

Strings in Python

What is a string?

Accessing Strings


Raw Strings

Concatenate Strings

Reverse Strings

Changing Upper and Lower Case Strings

Replace Strings

Repeat Strings

Split Strings

Startswith / Endswith

Strip Strings

Slicing Strings

Formatting Strings

Join Strings

Testing Strings

Built-in String Methods

Lists in Python

What is a List?

List Creation

List Length

List Append

List Insert

List Remove

List Extend

List Delete

List Keywords

List Reverse

List Sorting

List Split

List Indexing

List Slicing

List Loops

List Methods

List Examples

Dictionaries in Python

What is a Dictionary?

How to create a Dictionary?

Accessing / Getting values

Looping through a Dictionary

Updating a Dictionary

Delete a key / value

Example from Google Class

Dict Formatting

Common Dictionary Operations

Dictionary Manipulation in Python

Methods of Dictionary Objects

String Manipulation in Python

Methods of String objects

List Manipulation in Python

Methods of List objects


Why Loops?

For Loops

Example of a for loop

Loop through words

Using the range function

While Loop

Example of a While Loop

Count with While Loops

Eternal Loops

Nested Loops

Breaking out of Loops

Break Example


Continue Example


List Comprehensions in Python



Create a list using loops and list comprehension

Parsing a file using list comprehension

Using list comprehension in functions


Why functions?

How do I create a function?


There is a Function - Cheat Sheet at the top of the page. 

Conditional statements in Python

How to use Conditional Statements

If Statement

Elif Statement

Else Statement


If..Elif..Else Statement

What are Conditions?

When to use a Condition?

Syntax Explained

Conditional Tests

Python If statement Code Block


What are Modules?

Different ways to import modules

Please see the Modules - Cheat Sheet at the top of the page

Reading and Writing Files in Python

File Types

Open ( )

File Modes

Create a text file

How to read a text file

Looping over a file object

File Handling Usages

With Statement

With Examples

Read a file line by line into an list

Splitting Lines

With Statement in Python

With Statement Overview

With Statement Usage

Python Style Rules


Line length



Blank Lines


Shebang Line


and more...

Python Language Rules





Global variables

Nested/Local/Inner Classes and Functions

List Comprehensions

Default Iterators and Operators


Lambda Functions

Conditional Expressions

and more...

Share this article

Recommended Python Training – DataCamp

For Python training, our top recommendation is DataCamp.

Datacamp provides online interactive courses that combine interactive coding challenges with videos from top instructors in the field.

Datacamp has beginner to advanced Python training that programmers of all levels benefit from.


Download Our Free Guide To Learning Python

* indicates required

Read more about:
Disclosure of Material Connection: Some of the links in the post above are “affiliate links.” This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, only recommend products or services that we try personally and believe will add value to our readers.