freeprogrammingbooks.com

How To Code in Python 3

By Lisa Tagliaferri

How To Code in Python 3 book cover

Python remains the most accessible entry point into programming for beginners and the go-to language for professionals in AI, data science, and automation. In 2026, it continues to dominate the tech landscape, appearing in nearly half of all software development job postings.

Its clean syntax and vast ecosystem make it the default choice for first-time learners and experienced developers alike. Having a solid, structured guide that covers both fundamentals and best practices is essential for anyone looking to build a career in software development.

About the book

How To Code in Python 3 is a comprehensive, beginner-friendly guide published by DigitalOcean’s community team. Written by Lisa Tagliaferri with contributions from a team of experienced technical writers, this book walks readers through Python programming from the ground up.

No prior programming experience is required. The book covers everything from setting up a development environment to writing modular, object-oriented code. Each chapter builds on the previous one, reinforcing concepts with practical examples and clear explanations. By the end, readers will have a solid understanding of Python 3 and be ready to tackle real-world projects.

What you will learn

  • Install Python 3 on Linux, macOS, and Windows
  • Work with data types, variables, strings, and operators
  • Use lists, tuples, dictionaries, and list comprehensions
  • Write conditional statements, loops, and functions
  • Build classes, understand inheritance and polymorphism
  • Import and create modules for code organization
  • Debug code using the Python debugger and logging tools
  • Port Python 2 code to Python 3

Table of contents

  • Introduction
  • Python 2 vs Python 3: Practical Considerations
  • How To Install Python 3 and Set Up a Local Programming Environment on Ubuntu 16.04
  • How To Install Python 3 and Set Up a Local Programming Environment on macOS
  • How To Install Python 3 and Set Up a Local Programming Environment on Windows 10
  • How To Install Python 3 and Set Up a Local Programming Environment on CentOS 7
  • How To Install Python 3 and Set Up a Programming Environment on an Ubuntu 16.04 Server
  • How To Write Your First Python 3 Program
  • How To Work with the Python Interactive Console
  • How To Write Comments
  • Understanding Data Types
  • An Introduction to Working with Strings
  • How To Format Text
  • An Introduction to String Functions
  • How To Index and Slice Strings
  • How To Convert Data Types
  • How To Use Variables
  • How To Use String Formatters
  • How To Do Math with Operators
  • Built-in Python 3 Functions for Working with Numbers
  • Understanding Boolean Logic
  • Understanding Lists
  • How To Use List Methods
  • Understanding List Comprehensions
  • Understanding Tuples
  • Understanding Dictionaries
  • How To Import Modules
  • How To Write Modules
  • How To Write Conditional Statements
  • How To Construct While Loops
  • How To Construct For Loops
  • How To Use Break, Continue, and Pass Statements when Working with Loops
  • How To Define Functions
  • How To Use *args and **kwargs
  • How To Construct Classes and Define Objects
  • Understanding Class and Instance Variables
  • Understanding Inheritance
  • How To Apply Polymorphism to Classes
  • How To Use the Python Debugger
  • How To Debug Python with an Interactive Console
  • How To Use Logging
  • How To Port Python 2 Code to Python 3

More books in: Programming, Python


Legal notice: This book is shared for educational purposes only. The content is distributed under Creative Commons licenses or with explicit permission from the author. FreeProgrammingBooks may host files that comply with their respective licenses.