Python Field Guide
A hands-on reference for learning Python — run every example on this site without installing anything.
What's inside
- Basic Data Types — the scalar building blocks (
int,float,str,bool) that hold a single value. - Collections of Data —
list,tuple,dict, andset, for grouping multiple values together. - Conditionals —
if/elif/elsestatements that run code only when a condition isTrue. - Loops —
forandwhileloops for repeating a block of code. - OOP — classes and objects, for bundling data together with the behavior that belongs to it.
Try it yourself
# run this code below
discoveries = ["write a comment"]
discoveries.append("create a list")
print("Field journal created.\n")
print("Explorer begins their first expedition into Python.\n")
discoveries.append("print console output")
print("Discoveries so far:")
discoveries.append("iterate through a list with a for loop")
discoveries.append("string concatenation")
for discovery in discoveries:
print("-\t"+discovery)