Show Menu
Cheatography

Python Introduction Cheat Sheet (DRAFT) by

Introductory Python.

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Base Concepts and Types

Variable name is case sensitive
Type: str, bool, float, int
Convert Type: str( ), float( )

Lists

[inclusive : exclusive]
Example: fam[:4], fam[5:]
fam[-1]
The last element
del(fa­m[-1])
Remove
Equal sign means reference: X = [1, 2, 3], Y = X
The initial index is 0.

Lists

[inclusive : exclusive]
Example: fam[:4], fam[5:]
fam[-1]
The last element
del(fa­m[-1])
Remove
X = [1, 2, 3], Y = X
Shallow copy: Reference
Y = list(X)
Deep copy
The initial index is 0.