Book description
A long journey is really a lot of little steps. The same is true when you're learning Python, so you may as well have some fun along the way! Written in a lighthearted style with entertaining exercises that build powerful skills, Tiny Python Projects takes you from amateur to Pythonista as you create 22 bitesize programs. Each tiny project teaches you a new programming concept, from the basics of lists and strings right through to regular expressions and randomness. Along the way you'll also discover how testing can make you a better programmer in any language.About the Technology
Who says learning to program has to be boring? The 21 activities in this book teach Python fundamentals through puzzles and games. Not only will you be entertained with every exercise, but you'll learn about text manipulation, basic algorithms, and lists and dictionaries as you go. It's the ideal way for any Python newbie to gain confidence and experience.
About the Book
The projects are tiny, but the rewards are big: each chapter in Tiny Python Projects challenges you with a new Python program, including a password creator, a word rhymer, and a Shakespearean insult generator. As you complete these entertaining exercises, you'll graduate from a Python beginner to a confident programmer—and you'll have a good time doing it!
What's Inside
- Write command-line Python programs
- Manipulate Python data structures
- Use and control randomness
- Write and run tests for programs and functions
- Download testing suites for each project
About the Reader
For readers with beginner programming skills.
About the Author
Ken Youens-Clark is a Senior Scientific Programmer at the University of Arizona. He has an MS in Biosystems Engineering and has been programming for over 20 years.
Quotes
Tiny Python Projects is a gentle, amusing introduction to Python that will firm up several key concepts while occasionally making you snicker.
- Amanda Debler, Schaeffler Technologies
Knowledge meets humor meets succinctness. A gem.
- Mafinar Khan, theScore
Learning based on doing small projects is effective, and that’s why this book is perfect.
- Marcin Sęk, e-Xim IT
Excellent pick for those who want to improve coding skills with Python.
- José Apablaza, Steadfast
Publisher resources
Table of contents
- Tiny Python Projects
- Copyright
- brief contents
- contents
- front matter
-
0 Getting started: Introduction and installation guide
- Writing command-line programs
- Using test-driven development
- Setting up your environment
- Code examples
- Getting the code
- Installing modules
- Code formatters
- Code linters
- How to start writing new programs
- Why not Notebooks?
- The scope of topics we’ll cover
- Why not object-oriented programming?
- A note about the lingo
-
1 How to write and test a Python program
- 1.1 Creating your first program
- 1.2 Comment lines
- 1.3 Testing your program
- 1.4 Adding the #! (shebang) line
- 1.5 Making a program executable
- 1.6 Understanding $PATH
- 1.7 Adding a parameter and help
- 1.8 Making the argument optional
- 1.9 Running our tests
- 1.10 Adding the main() function
- 1.11 Adding the get_args() function
- 1.12 Testing hello.py
- 1.13 Starting a new program with new.py
- 1.14 Using template.py as an alternative to new.py
- Summary
-
2 The crow’s nest: Working with strings
-
2.1 Getting started
- 2.1.1 How to use the tests
- 2.1.2 Creating programs with new.py
- 2.1.3 Write, test, repeat
- 2.1.4 Defining your arguments
- 2.1.5 Concatenating strings
- 2.1.6 Variable types
- 2.1.7 Getting just part of a string
- 2.1.8 Finding help in the REPL
- 2.1.9 String methods
- 2.1.10 String comparisons
- 2.1.11 Conditional branching
- 2.1.12 String formatting
- 2.1.13 Time to write
- 2.2 Solution
- 2.3 Discussion
- 2.4 Going further
- Summary
-
2.1 Getting started
- 3 Going on a picnic: Working with lists
- 4 Jump the Five: Working with dictionaries
- 5 Howler: Working with files and STDOUT
- 6 Words count: Reading files and STDIN, iterating lists, formatting strings
- 7 Gashlycrumb: Looking items up in a dictionary
- 8 Apples and Bananas: Find and replace
- 9 Dial-a-Curse: Generating random insults from lists of words
- 10 Telephone: Randomly mutating strings
- 11 Bottles of Beer Song: Writing and testing functions
- 12 Ransom: Randomly capitalizing text
- 13 Twelve Days of Christmas: Algorithm design
- 14 Rhymer: Using regular expressions to create rhyming words
- 15 The Kentucky Friar: More regular expressions
- 16 The scrambler: Randomly reordering the middles of words
- 17 Mad Libs:Using regular expressions
- 18 Gematria: Numeric encoding of text using ASCII values
- 19 Workout of the Day: Parsing CSV files, creating text table output
- 20 Password strength: Generating a secure and memorable password
- 21 Tic-Tac-Toe: Exploring state
- 22 Tic-Tac-Toe redux: An interactive version with type hints
- Epilogue
- Appendix. Using argparse
- index
Product information
- Title: Tiny Python Projects
- Author(s):
- Release date: August 2020
- Publisher(s): Manning Publications
- ISBN: 9781617297519
You might also like
video
Python A-Z: Learn Python by Building 15 Projects and ChatGPT
This comprehensive Python course covers all fundamental concepts and advanced Python concepts, and you learn a …
book
Python for Programmers
The professional programmer’s Deitel® guide to Python® with introductory artificial intelligence case studies Written for programmers …
book
Dead Simple Python
Dead Simple Python is a thorough introduction to every feature of the Python language for programmers …
book
Impractical Python Projects
Impractical Python Projects picks up where the complete beginner books leave off, expanding on existing concepts …