Python essentials

John C. Shovic, 1957-

Book - 2024

"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"--

Saved in:
1 copy ordered
Subjects
Genres
handbooks
Handbooks and manuals
Guides et manuels
Published
Hoboken, NJ : John Wiley & Sons, Inc [2024]
Language
English
Main Author
John C. Shovic, 1957- (author)
Other Authors
Alan Simpson, 1953- (author)
Item Description
Includes index.
Physical Description
ix, 180 pages : illustrations ; 22 cm
ISBN
9781394263479
  • 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
  • Installing Python and VS Code
  • Installing the Python extension
  • Letting AI write your Python code
  • Using GitHub Copilot
  • Chapter 2. Using Interactive Mode, Getting Help, and Writing Apps
  • Using Python's Interactive Mode
  • Opening Terminal
  • Going into the Python Interpreter
  • Entering commands
  • Using Python's built-in help
  • Exiting interactive help
  • Searching for specific help topics online
  • Creating a Folder for Your Python Code
  • Typing, Editing, and Debugging Python Code
  • Writing Python code
  • Saving your code
  • Running Python in VS Code
  • Learning simple debugging
  • Closing a file
  • 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
  • Numbers
  • Words (strings)
  • Booleans
  • Working with Python Operators
  • Arithmetic operators
  • Comparison operators
  • Boolean operators
  • Creating and Using Variables
  • Creating valid variable names
  • Creating variables in code
  • Manipulating variables
  • Saving your work
  • Running your Python app in VS Code
  • 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
  • Formatting with f-strings
  • Showing dollar amounts
  • Formatting percent numbers
  • Formatting width and alignment
  • Grappling with Weirder Numbers
  • Manipulating Strings
  • Concatenating strings
  • Getting the length of a string
  • Working with common string operators
  • Manipulating strings with methods
  • Uncovering Dates and Times
  • Working with dates
  • Calculating timespans
  • Chapter 6. Controlling the Action
  • Main Operators for Controlling the Action
  • Making Decisions with if
  • Adding else to your if logic
  • Ternary operations
  • Repeating a Process with for
  • Looping through numbers in a range
  • Looping through a list
  • Bailing out of a loop
  • Looping with continue
  • Nesting loops
  • Looping with while
  • Starting while loops over with continue
  • Breaking while loops with break
  • Chapter 7. Speeding Along with Lists and Tuples
  • Defining and Using Lists
  • Referencing list items by position
  • Looping through a list
  • Seeing whether a list contains an item
  • Getting the length of a list
  • Adding an item to the end of a list
  • Inserting an item into a list
  • Changing an item in a list
  • Combining lists
  • Removing list items
  • Clearing out a list
  • Counting how many times an item appears in a list
  • Finding a list item's index
  • Alphabetizing and sorting lists
  • Reversing a list
  • Copying a list
  • 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
  • Defining optional parameters with defaults
  • Passing multiple values to a function
  • Using keyword arguments (kwargs)
  • Passing in an arbitrary number of arguments
  • 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
  • Looping with readlines()
  • Looping with readline()
  • Appending versus overwriting files
  • Using tell() to determine the pointer location
  • Moving the pointer with seek()
  • Reading and Copying a Binary File
  • Chapter 11. Juggling JSON Data
  • Organizing JSON Data
  • Understanding Serialization
  • Loading Data from JSON Files
  • Converting an Excel date to a JSON date
  • Loading unkeyed JSON from a Python string
  • Loading keyed JSON data from a Python string
  • Changing JSON data
  • Removing data from a dictionary
  • Dumping Python Data to JSON
  • Chapter 12. Interacting with the Internet
  • Seeing How the Web Works
  • Understanding the mysterious URL
  • Exposing the HTTP headers
  • Opening a URL from Python
  • Posting to the web with Python
  • Scraping the web with Python
  • Storing the parsed content
  • Chapter 13. Libraries, Packages, and Modules
  • Understanding the Python Standard Library
  • Using the dir() function
  • Using the help() function
  • Exploring built-in functions
  • 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
  • Controiling Your Program
  • Understanding Python Functions
  • Figuring Out Errors
  • Using Other People's Modules
  • Using the Web and Al When You Have Problems
  • Index