<p><p>Learn programming with Python by creating a text adventure. This book will teach you the fundamentals of programming, how to organize code, and some coding best practices. By the end of the book, you will have a working game that you can play or show off to friends. You will also be able to ch
Make Your Own Python Text Adventure: A Guide to Learning Programming
✍ Scribed by Phillip Johnson
- Publisher
- Apress
- Year
- 2017
- Tongue
- English
- Leaves
- 156
- Category
- Library
No coin nor oath required. For personal study only.
✦ Synopsis
Learn programming with Python by creating a text adventure. This book will teach you the fundamentals of programming, how to organize code, and some coding best practices. By the end of the book, you will have a working game that you can play or show off to friends. You will also be able to change the game and make it your own by writing a different story line, including new items, creating new characters, and more. Make your own Python Text Adventure offers a structured approach to learning Python that teaches the fundamentals of the language, while also guiding the development of the customizable game. The first half of the book introduces programming concepts and Python syntax by building the basic structure of the game. You'll also apply the new concepts in homework questions (with solutions if you get stuck!) that follow each chapter. The second half of the book will shift the focus to adding features to your game and making it more entertaining for the player. Python is often recommended as a first programming language for beginners, and for good reason. Whether you've just decided to learn programming or you've struggled before with vague tutorials, this book will help you get started. What You'll Learn Install Python and set up a workspace Master programming basics and best practices including functions, lists, loops and objects Create an interactive adventure game with a customizable world Who This Book Is For People who have never programmed before or for novice programmers starting out with Python.
✦ Table of Contents
Table of Contents
About the Author
About the Technical Reviewer
Chapter 1: Getting Started
Introduction
Who This Book Is For
How To Use This Book
Setting Up Your Workspace
Python Versions
Installing Python
Windows
Mac OS X
Linux
Verify Your Installation
Chapter 2: Your First Program
Creating a Module
Writing Code
Running Python Programs
Homework
Chapter 3: Listening to Your Users
Your Friends: stdout and stdin
Reading from Standard Input
Saving Information
Data Types
Homework
Chapter 4: Decisions
Booleans
If-statements
Boolean Operations
Homework
Chapter 5: Functions
Data In, Data Out
Homework
Chapter 6: Lists
What Is a List?
Common List Operations
Add
Length
Get
Search
Adding Lists to the Game
Homework
Chapter 7: Loops
While Loops
For-Each Loops
Loop Counters
Ranges
Using Enumerate
Nesting
The Game Loop
Homework
Chapter 8: Objects
Object Members
Defining Objects with Classes
Using init() to Initialize Objects
Using str() to Print Objects
Adding Weapons to the Game
A Dash of Object-Oriented Programming
Homework
Chapter 9: Exceptions
Validating User Input
Checking Object Members
Raising Exceptions Intentionally
Homework
Chapter 10: Intermezzo
Organizing Code Into Multiple Files
Importing from Other Files
Homework
Chapter 11: Building Your World
The X-Y Grid
Moving in the World
Chapter 12: Making the World More Interesting
Enemies
Do You Have Any Potions…or Food?
Chapter 13: World-Building Part 2
Dictionaries
Creating a Dictionary
Get
Add/Update
Delete
Loop
Limiting Actions
Expanding the World
Chapter 14: Econ 101
Share the Wealth
Giving the Trader a Home
Expanding the World
Chapter 15: Endgame
Finishing Up
What Next?
Add More Features to the Game
Make Your Job Easier with Python Scripts
Write a Web Application
Appendix A: Homework Solutions
Chapter 2: Your First Program
Chapter 3: Listening to Your Users
Chapter 4: Decisions
Chapter 5: Functions
Chapter 6: Lists
Chapter 7: Loops
Chapter 8: Objects
Chapter 9: Exceptions
Appendix B: Common Errors
AttributeError
NameError
TypeError
Index
📜 SIMILAR VOLUMES
<div><p>Learn programming with Python by creating a text adventure. This book will teach you the fundamentals of programming, how to organize code, and some coding best practices. By the end of the book, you will have a working game that you can play or show off to friends. You will also be able to
Learn programming with Python by creating a text adventure. This book will teach you the fundamentals of programming, how to organize code, and some coding best practices. By the end of the book, you will have a working game that you can play or show off to friends. You will also be able to change t
<p> </p><p>If you want to learn the most modern programming language in the world, then keep reading. Python is an high-level programming language. It's a modern language, easy to learn and understand but very powerful.</p><p>It's a versatile programming language that is now being used on a lot o
<p><b>Learn how to bake easy but elaborately decorated cakes—no fondant needed!</b><p>Erin Gardner's cake recipes share a delicious, time-saving secret: they're all the same. Why play the guessing game of sifting through dozens of recipes when all you need are just a few that contain hundreds