Book description
This edition offers updated content covering Python 3.9 to 3.12, new chapters on type hinting and CLI applications, and expanded practical examples, making it the ideal resource for both new and experienced Python programmers
Key Features
- Learn to create and deploy APIs and CLI applications, leveraging Python’s strengths in scripting and automation
- Stay current with the latest features and improvements in Python, including pattern matching and the latest exception handling syntax
- Engage with new real-world examples and projects, including competitive programming problems, to solidify your understanding of Python
Book Description
Learn Python Programming, Fourth Edition provides a comprehensive, up-to-date introduction to Python programming, covering fundamental concepts and practical applications. This edition has been meticulously updated to include the latest features from Python versions 3.9 to 3.12, new chapters on type hinting and CLI applications, and updated examples reflecting modern Python development practices. The book empowers you to take ownership of writing your software and become independent in fetching the resources you need. You will have a clear idea of where to go and how to build on what you have learned from the book
Through examples, the book explores a wide range of applications and concludes by building real-world Python projects based on the concepts you have learned. This book offers a clear and practical guide to mastering Python and applying it effectively in various domains such as data science, web development, and automation.
What you will learn
- Install and Set Up Python on Windows, Mac, and Linux
- Write Elegant, Reusable, and Efficient Code
- Avoid Common Pitfalls like duplication and over-engineering
- Use Functional and Object-Oriented Programming Approaches appropriately
- Build APIs with FastAPI and program CLI applications
- Understand Data Persistence and Cryptography for secure applications
- Manipulate Data Efficiently using Python's built-in data structures
- Package Your Applications for distribution via the Python Package Index (PyPI)
- Solve Competitive Programming Problems with Python
Who this book is for
This book is for everyone who wants to learn Python from scratch, as well as experienced programmers looking for a reference book. Prior knowledge of basic programming concepts will help you follow along, but it’s not a prerequisite.
Table of contents
- Learn Python Programming, Fourth Edition: A Comprehensive, Up-to-Date, and Definitive Guide to Learning Python
-
1 A Gentle Introduction to Python
- Join our book community on Discord
- A proper introduction
- Enter the Python
- About Python
- What are the drawbacks?
- Who is using Python today?
- Setting up the environment
- Installing Python
- How to run a Python program
- How is Python code organized?
- Python's execution model
- Guidelines for writing good code
- Python culture
- A note on IDEs
- A word about AI
- Summary
- 2 Built-In Data Types
- 3 Conditionals and Iteration
- 4 Functions, the Building Blocks of Code
- 5 Comprehensions and Generators
-
6 OOP, Decorators, and Iterators
- Decorators
-
Object-oriented programming (OOP)
- The simplest Python class
- Class and object namespaces
- Attribute shadowing
- The self argument
- Initializing an instance
- OOP is about code reuse
- Accessing a base class
- Multiple inheritance
- Class and static methods
- Private methods and name mangling
- The property decorator
- The cached_property decorator
- Operator overloading
- Polymorphism – a brief overview
- Data classes
- Writing a custom iterator
- Summary
- 7 Exceptions and Context Managers
- 8 Files and Data Persistence
- 9 Cryptography and Tokens
- 10 Testing
Product information
- Title: Learn Python Programming - Fourth Edition
- Author(s):
- Release date: December 2024
- Publisher(s): Packt Publishing
- ISBN: 9781835882948
You might also like
book
Learn Python Programming - Third Edition
Get up and running with Python 3.9 through concise tutorials and practical projects in this fully …
book
Introducing Python, 2nd Edition
Easy to understand and fun to read, this updated edition of Introducing Python is ideal for …
book
Automate the Boring Stuff with Python, 2nd Edition
If you’ve ever spent hours renaming files or updating hundreds of spreadsheet cells, you know how …
book
Fluent Python, 2nd Edition
Don't waste time bending Python to fit patterns you've learned in other languages. Python's simplicity lets …