Cover
Title Page
Copyright
Introduction
About This Book
Foolish Assumptions
Icons Used in This Book
Where to Go from Here
Chapter 1: Starting with Python
Why Python Is Hot
Choosing the Right Python
Tools for Success
Chapter 2: Using Interactive Mode, Getting Help, and Writing Apps
Using Python’s Interactive Mode
Creating a Folder for Your Python Code
Typing, Editing, and Debugging Python Code
Chapter 3: Python Elements and Syntax
The Zen of Python
Introducing Object-Oriented Programming
Discovering Why Indentations Count, Big Time
Using Python Modules
Chapter 4: Building Your First Python Application
Opening the Python App File
Typing and Using Python Comments
Understanding Python Data Types
Working with Python Operators
Creating and Using Variables
Understanding What Syntax Is and Why It Matters
Chapter 5: Working with Numbers, Text, and Dates
Calculating Numbers with Functions
Still More Math Functions
Formatting Numbers
Grappling with Weirder Numbers
Manipulating Strings
Uncovering Dates and Times
Chapter 6: Controlling the Action
Main Operators for Controlling the Action
Making Decisions with if
Repeating a Process with for
Looping with while
Chapter 7: Speeding Along with Lists and Tuples
Defining and Using Lists
What’s a Tuple and Who Cares?
Working with Sets
Chapter 8: Wrangling Bigger Chunks of Code
Creating a Function
Commenting a Function
Passing Information to a Function
Returning Values from Functions
Chapter 9: Sidestepping Errors
Understanding Exceptions
Handling Errors Gracefully
Being Specific about Exceptions
Keeping Your App from Crashing
Adding an else to the Mix
Using try … except … else … finally
Raising Your Own Exceptions
Chapter 10: Working with External Files
Understanding Text and Binary Files
Opening and Closing Files
Reading a File’s Contents
Looping through a File
Reading and Copying a Binary File
Chapter 11: Juggling JSON Data
Organizing JSON Data
Understanding Serialization
Loading Data from JSON Files
Dumping Python Data to JSON
Chapter 12: Interacting with the Internet
Seeing How the Web Works
Chapter 13: Libraries, Packages, and Modules
Understanding the Python Standard Library
Exploring Python Packages
Importing Python Modules
Chapter 14: The Ten Most Essential Aspects of Python
Being Pythonic
Identifying the Importance of Indents
Understanding Python Syntax
Appreciating the Flexibility of Python Variables
Seeing Lists as Your Friend
Controlling Your Program
Understanding Python Functions
Figuring Out Errors
Using Other People’s Modules
Using the Web and AI When You Have Problems
Index
About the Authors
Connect with Dummies
End User License Agreement
Python Essentials For Dummies is a quick reference to all the core concepts in Python, the multifaceted general-purpose language used for everything from building websites to creating apps. This book gets right to the point, with no excess review, wordy explanations, or fluff, making it perfect as a desk reference on the job or as a brush-up as you expand your skills in related areas. Focusing on just the essential topics you need to know to brush up or level up your Python skill, this is the reliable little book you can always turn to for answers.
Get a quick and thorough intro to the basic concepts of coding in Python
Review what you've already learned or pick up essential new skills
Create websites, software, machine learning, and automation for school or work
Keep this concise reference book handy for jogging your memory as you code
This portable Dummies Essentials book focuses on the key topics you need to know about the popular Python language. Great for supplementing a course, reviewing for a certification, or staying knowledgeable on the job.