Programming with Python for Engineers¶
Programming with Python for Engineers
An interactive book introducing Python to engineers and engineering students.
The writing of the book is still ongoing and there may be updates.
All comments and updates welcome. See how you can contribute. We thank our contributors.
Disclaimer: The PDF version is automatically generated and may include errors. Prefer HTML or Colab versions for the time being.
Copyright: All rights reserved.
BibTeX entry for citing the book
@book{kalkan2021,
title={Programming with Python for Engineers},
author={Sinan Kalkan and Onur Tolga Sehitoglu and Gokturk Ucoluk},
note={\url{https://ceng240.github.io/}},
year={2021}
}
Table of contents
- 1. Basic Computer Organization
- 1.1. The von Neumann Architecture
- 1.2. The Memory
- 1.3. The CPU
- 1.4. The Fetch-Decode-Execute Cycle
- 1.5. The Stored Program Concept
- 1.6. Pros and Cons of the von Neuman Architecture
- 1.7. Peripherals of a computer
- 1.8. The running of a computer
- 1.9. Important Concepts
- 1.10. Further Reading
- 1.11. Exercises
- 2. A Broad Look at Programming and Programming Languages
- 3. Representation of Data
- 4. Dive into Python
- 4.1. Basic Data
- 4.2. Container data (str, tuple, list, dict, set)
- 4.3. Expressions
- 4.4. Basic Statements
- 4.5. Compound Statements
- 4.6. Basic actions for interacting with the environment
- 4.7. Actions that are ignored
- 4.8. Actions and data packaged in libraries
- 4.9. Providing your actions to the interpreter
- 4.10. Important Concepts
- 4.11. Further Reading
- 4.12. Exercises
- 5. Conditional and Repetitive Execution
- 6. Functions
- 6.1. Why define functions?
- 6.2. Defining functions
- 6.3. Passing parameters to functions
- 6.4. Scope of variables
- 6.5. Higher-order functions
- 6.6. Functions in programming vs. functions in Mathematics
- 6.7. Recursion
- 6.8. Function Examples
- 6.9. Programming Style
- 6.10. Important Concepts
- 6.11. Further Reading
- 6.12. Exercises
- 7. A Gentle Introduction to Object-Oriented Programming
- 8. File Handling
- 8.1. First Example
- 8.2. Files and Sequential Access
- 8.3. Data Conversion and Parsing
- 8.4. Accessing Text Files Line by Line
- 8.5. Termination of Input
- 8.6. Example: Processing CSV Files
- 8.7. Formatting Files
- 8.8. Binary Files
- 8.9. Note on Files, Directory Organization and Paths
- 8.10. List of File Class Member Functions
- 8.11. Important Concepts
- 8.12. Further Reading
- 8.13. Exercises
- 9. Error Handling and Debugging
- 10. Scientific and Engineering Libraries
- 11. An Application: Approximation and Optimization
- 12. An Application: Solving a Simple Regression Problem