Section 2.3 Arithmetic (Python Programming)

preview_player
Показать описание
This is an introductory level course on Python. It doesn't assume an prior programming knowledge or coding experience.

The best way to learn is to watch the video here. Go to the respective Jupyter notebook in the source code (see below) and execute the program. There are self-checks and programming assignments which you must do by yourself.

The course will cover the following sections from the Deitel & Deitel's textbook on Python [1]:

Chapter 1. Introduction to Computers and Python
1.10 Test-Drive: Using IPython and Jupyter Notebooks

Chapter 2. Introduction to Python Programming
2.1 Introduction
2.2 Variables and Assignment Statements
2.3 Arithmetic (-------------------------------------------------------------THIS LECTURE)
2.4 Function print and an Intro to Single- and Double-Quoted Strings
2.5 Triple-Quoted Strings
2.6 Getting Input from the User
2.7 Decision Making: The if Statement and Comparison Operators
2.8 Objects and Dynamic Typing

Chapter 3. Control Statements and Program Development
3.1 Introduction
3.2 Algorithms
3.3 Pseudocode
3.4 Control Statements
3.5 if Statement
3.6 if…else and if…elif…else Statements
3.7 while Statement
3.8 for Statement
3.9 Augmented Assignments
3.10 Program Development: Sequence-Controlled Repetition
3.11 Program Development: Sentinel-Controlled Repetition
3.12 Program Development: Nested Control Statements
3.13 Built-In Function range: A Deeper Look
3.14 Using Type Decimal for Monetary Amounts
3.15 break and continue Statements
3.16 Boolean Operators and, or, and not

Chapter 4. Functions
4.1 Introduction
4.2 Defining Functions
4.3 Functions with Multiple Parameters
4.4 Random-Number Generation
4.5 Case Study: A Game of Chance
4.6 Python Standard Library
4.7 math Module Functions
4.8 Using IPython Tab Completion for Discovery
4.9 Default Parameter Values
4.10 Keyword Arguments
4.11 Arbitrary Argument Lists
4.12 Methods: Functions That Belong to Objects
4.13 Scope Rules
4.14 import: A Deeper Look
4.15 Passing Arguments to Functions: A Deeper Look
4.16 Function-Call Stack
4.17 Functional-Style Programming

Chapter 5. Sequences: Lists and Tuples
5.1 Introduction
5.2 Lists
5.3 Tuples
5.4 Unpacking Sequences
5.5 Sequence Slicing
5.6 del Statement
5.7 Passing Lists to Functions
5.8 Sorting Lists
5.9 Searching Sequences
5.10 Other List Methods
5.11 Simulating Stacks with Lists
5.12 List Comprehensions
5.13 Generator Expressions
5.14 Filter, Map, and Reduce
5.15 Other Sequence Processing Functions
5.16 Two-Dimensional Lists

Chapter 6. Dictionaries and Sets
6.1 Introduction
6.2 Dictionaries
6.3 Sets

7. Array-Oriented Programming with NumPy
7.1 Introduction
7.2 Creating Arrays from Existing Data
7.3 Array Attributes
7.4 Filling Arrays with Specific Values
7.5 Creating Arrays from Ranges
7.6 List vs. Array Performance: Introducing %timeit
7.7 Array Operators
7.8 NumPy Calculation Methods
7.9 Universal Functions
7.10 Indexing and Slicing
7.11 Views: Shallow Copies
7.12 Deep Copies
7.13 Reshaping and Transposing

Chapter 8. Strings: A Deeper Look

Chapter 9. Files and Exceptions
9.1 Introduction
9.2 Files
9.3 Text-File Processing
9.4 Updating Text Files
9.5 Serialization with JSON
9.6 Focus on Security: pickle Serialization and Deserialization
9.7 Additional Notes Regarding Files
9.8 Handling Exceptions
9.9 finally Clause
9.10 Explicitly Raising an Exception

10. Object-Oriented Programming
10.1 Introduction
10.2 Custom Class Account
10.3 Controlling Access to Attributes
10.4 Properties for Data Access
10.5 Simulating “Private” Attributes
10.6 Case Study: Card Shuffling and Dealing Simulation
10.7 Inheritance: Base Classes and Subclasses
10.8 Building an Inheritance Hierarchy; Introducing Polymorphism
10.9 Duck Typing and Polymorphism
10.10 Operator Overloading
10.11 Exception Class Hierarchy and Custom Exceptions
10.12 Named Tuples
10.13 A Brief Intro to Python 3.7’s New Data Classes
10.14 Unit Testing with Docstrings and doctest
10.15 Namespaces and Scopes

Textbook (Deitel and Deitel):

You can find the source code (both as .py files and Jupyter notebooks) at GitHub:

You can download the entire code as a single ZIP file from here:

Notes:
1. I assume you have Anaconda installed. Set up a Python environment with Python 3.12.
2. If you can't find any video in the above list, it means it hasn't been recorded and uploaded yet. Subscribe to the channel to get notified about the video when it is uploaded.
3. If you have questions for me to answer, post them here in the comments and I will try to answer within two days.

Thank you and good luck.

Dr. Tufail Khan
Рекомендации по теме
visit shbcf.ru