Introductory Python Using Linux
Preface
You will be ready for engineering programming after completing the first six chapters of this tutorial. Chapter six concludes the first part of this tutorial with a bubble sort sample program. It combines all the elements described in the first part of the manual. It includes, variables, loops, if statements, lists, and functions.
Table of Contents
Chapter 1 - Introduction to Python Programming
- 1.1 Install Python and Install PyCharm
- 1.2 Running Python without PyCharm
- 1.3 Saving Your Work from PyCharm
- 1.4 Variables
- 1.5 PyCharm Screen
- 1.6 Adding a New PyCharm Project
- 1.7 Simple Programs Using Print & Input
- 1.8 Lists as Arrays in Python
Chapter 2 - Python Loops
- 2.1 Python For loops
- 2.2 Python While loops
- 2.3 Breaking an endless loop
Chapter 3 - Python if statements
- 3.1 A simple if statements
- 3.2 An if-else statement
- 3.3 An if-elif-else statement
- 3.4 Conditional operators
- 3.5 Logical operators
Chapter 4 - Python custom and builtin functions
- 4.1 Python custom functions
- 4.2 Python built-in functions
- 4.3 Default value for a function parameter
Chapter 5 - Python variable scope
- 5.1 Variable local and global scope
Chapter 6 - Python sample program - bubble sort
- 6.1 Example program using many Python features
Chapter 7 - Python variables, methods, and classes in object oriented Programming
- 7.1 Variables and methods
- 7.2 Creating a class
- 7.3 Creating two objects using the class
- 7.4 Creating a method in the class
- 7.5 Updating employee info
- 7.6 Adding an Employee class variable
Chapter 8 - Creation of Python inheritance for a class
- 8.1 Creation of a child class that inherits properties
Chapter 9 - Python matplotlib for graphs
- 9.1 A simple plot
- 9.2 Installing the matplotlib package
Chapter 10 - Working with files
- 10.1 Open, close, append, remove, rename, create, and read files.
Chapter 11 - Python formatting with % and .print
- 11.1 Python printing with the % operator
- 11.2 Python printing with .format
Chapter 12 - Using Python zip, dictionary, and comprehension
- 12.1 Initializing a dictionary with zip
- 12.2 Initializing a dictionary with comprehension
- 12.3 Create a dictionary of keys to numbers
Chapter 13 - Slicing Arrays
- 13.1 Slicing arrays (as for machine learning)
We are writing this manual for first year engineering students who need to know basic programming. Typically this will be in an introduction to engineering course. The goal is to get you up and running programs as quickly as possible. We will give you all the building blocks to create advanced programs. Programs can be copy and pasted to your editor from the web page. Why Python? I have written tutorials for Excel programming, and LibreOffice Calc. You should use these depending on your school. Python is capable of infinitely more than what is covered in this tutorial. It is used in web applications, science, and machine learning (artificial intelligence). Even though C++ runs faster, Python development times are much faster. Python is friendly.