DEV Community

Cover image for I wrote a short, introductory book for Python
Sundeep
Sundeep

Posted on • Originally published at learnbyexample.github.io

I wrote a short, introductory book for Python

Hello!

I recently published my ebook titled "100 Page Python Intro". This book is a short, introductory guide for the Python programming language. This book is well suited:

  • As a reference material for Python beginner workshops
  • If you have prior experience with another programming language
  • If you want a complement resource after reading a Python basics book, watching a video course, etc

Ebook links

🎉🎉 To celebrate, I'm giving away FREE PDF/EPUB versions (until 17 Feb, 2021) along with some of my other books. You can get them from Gumroad/Leanpub using the links given below:

Book cover for 100 Page Python Intro

Web version

You can also read the entire book as a series of posts here:

GitHub repo

The https://github.com/learnbyexample/100_page_python_intro repo has program/example files, markdown source and other details about the book.

Table of Contents

  1. Preface
  2. Introduction
  3. Numeric data types
  4. Strings and user input
  5. Defining functions
  6. Control structures
  7. Importing and creating modules
  8. Installing modules and Virtual environments
  9. Exception handling
  10. Debugging
  11. Testing
  12. Tuple and Sequence operations
  13. List
  14. Mutability
  15. Dict
  16. Set
  17. Text processing
  18. Comprehensions and Generator expressions
  19. Dealing with files
  20. Executing external commands
  21. Command line arguments

Motivation and FAQ

I've been conducting a few Python introduction workshops for college students and faculty for the past four years (which came to a premature end thanks to the pandemic). These students were already familiar with another programming languages such as C, Java, etc. I used to provide my notes in PDF format as a workshop reference material, further reading resources, etc. After I started writing a book titled Practice Python Projects, I realized I'd be better served by improving my Python knowledge first. What better way to do it than writing a book? And it did teach me a lot of things, some of the highlights being:

  • Exploring docs.python: Glossary
  • You cannot have mutable objects as a set element!
  • startswith() and endswith() string methods support tuple argument for testing multiple substrings
  • Command line options like -q, -B, etc

Why is it called "100 Page Python Intro" when it has more than 100 pages?

There are 2 hard problems in computer science: cache invalidation, naming things, and off-by-1 errors — Leon Bambrick

The material I was using for my workshops was 56 pages. I had more chapters to add, but I thought it would be a struggle to reach 100 pages, instead of overshooting the goal in the end. The measurement also depends on a few factors. The main content will be less than 100 pages if I reduce the font size from 12 to 11, exclude cover, TOC, Preface, etc.

Feedback

Hope you find it useful and fun to learn Python. As always, I'd highly appreciate your feedback. Please do let me know if you spot any error or typo.

Happy learning :)

Top comments (0)