An Introduction to the Art of Computer Programming Using Python in the Age of Generative AI

Preface: Computer Programming in the Age of AI

With the rise of generative AI, a basic understanding of programming concepts can go a long way. This website aims to teach the basics of Python, an accessible and versatile programming language.

I. Computer Memory and Data Representation

Discover the basics of binary data representation in Python with practical examples in this introductory chapter.

II. Numbers and Arithmetic

Learn the basics of working with numeric types and basic arithmetic in Python through illustrative Python code examples.

III. Strings and Text Data

A comprehensive exploration of strings in Python, covering their creation, manipulation, common operations, formatting, and Unicode handling, complete with practical code examples.

IV. Booleans and Logical Operations

Learn the basics of Boolean and logical operations in Python, and see how to make decisions and control program flow with practical examples.

V. Lists and Tuples

Delve into the intricacies of Python's lists and tuples through a visualization and explore their creation, manipulation, and best use cases with in-depth explanations and practical code examples.

VI. Dictionaries and Sets

Explore the concept of hashed tables with a visualization, and explore Python's dictionaries and sets with manipulation methods and practical applications with illustrative examples.

VII. Control Flow and Looping

This chapter introduces control flow and loops in Python, covering if-else conditions, for and while loops, and the use of break and continue statements, all with practical examples.

VIII. Comprehensions

Comprehensions in Python are concise syntactic constructs that allow you to create lists, dictionaries, and sets of iterable sequences in a single line of code.

IX. Functions

Learn how to define and call functions in Python, handle return values, use default and keyword arguments, understand the scope of variables, and work with lambda functions, all accompanied by practical examples to enhance understanding.

X. Error and Exception Handling

This chapter will guide you through error and exception handling in Python. You'll learn how to use try, except, else, and finally clauses, and how to throw your own exceptions when necessary.

XI. File Handling and I/O

This chapter covers basic concepts of file handling and I/O operations in Python. You'll learn how to read and write both text and binary files, manipulate file paths, and handle I/O errors to ensure robust file operations.

XII. Modules and Packages

In this chapter, you will learn about modules and packages in Python, including how to create and use them, the concept of built-in modules, and how to install third-party packages to add functionality to your Python programs.

XIII. Programming Paradigms

In this chapter, we will explore the concept of the three basic programming paradigms: Procedural, Object-Oriented, and Functional Programming.

XIV. Classes and Object-Oriented Programming

Explore the concepts and practices of object-oriented programming (OOP), beginning with its basic principles and philosophy.

XV. Functional Programming

In this chapter, we explore the principles of functional programming in Python, including pure functions, higher-order functions, and first-class functions. Clear examples are provided to illustrate these concepts.

XVI. Best Practices and Coding Conventions

This chapter covers best practices and coding conventions in Python, emphasizing the importance of clear naming, PEP 8 compliance, informative docstrings and avoiding global variables.

XVII. Introduction to Algorithms and Efficiency

Big-O notation is a mathematical representation that describes the upper bound of an algorithm's runtime or space requirements, helping to understand its worst-case efficiency as the input size grows.

XVIII. Data Structures

Data structures are essential computer science concepts for efficiently storing, organizing, and managing data, and they have a significant impact on program performance and efficiency.