Learning Scientific Programming with Python (2nd edition)
Examples
- E4.1: Assignment vs. the comparison operator
- E4.2: Exception tracebacks
- E4.3: String representation of vectors
- E4.4: Vector cross product
- E4.5: try ... except ... else ... finally
- E4.6: A simple dictionary of Roman numerals
- E4.7: A simple database of astronomical objects
- E4.8: Word lengths in the first line of the Gettysburg Address
- E4.9: Mersenne primes
- E4.10: The matrix transpose by list comprehension
- E4.11: lambda functions
- E4.12: Sorting methods
- E4.13: Triangular numbers
- E4.14: Assignment expressions (the walrus operator)
- E4.15: Issuing a usage method
- E4.16: Batch renaming of files
- E4.17: The Monty Hall problem
- E4.18: A simple Python class
- E4.19: The random-flight polymer
- E4.20: A 2D vector class
- E4.21: A simple 2D molecular dynamics simulation