Examples
- E2.1Numbers in the Python shell
- E2.2Simple mathematical expressions
- E2.3Heron's formula
- E2.4Python's type and id built-ins
- E2.5The return values of logic expressions
- E2.6The "is not" operator
- E2.7Integer object identity gotcha
- E2.8String concatenation with + and *
- E2.9String escaping
- E2.10Unicode
- E2.11String slicing
- E2.12String striding
- E2.13String methods
- E2.14A simple text table using Python strings
- E2.15String representation of integers with comma-separated thousands
- E2.16Using a Python list as a stack
- E2.17Splitting a string
- E2.18Assigning multiple variables in one statement
- E2.19The string join method
- E2.20The Fibonacci sequence
- E2.21The Gregorian calendar
- E2.22Euclid's algorithm for finding the gcd of a number
- E2.23A simple "turtle"
- E2.24Writing numbers to a file
- E2.25Reading numbers from a file
- E2.26Assigning a variable name to a function
- E2.27Default arguments to functions
- E2.28Function Scope
- E2.29The Lazy Caterer's sequence
- E2.30The Tower of Hanoi