The Python Quiz Book
$29.99
Minimum price
$35.00
Suggested price

The Python Quiz Book

About the Book

Quizzes are a fun way to test your knowledge of something. They make you think. The Python Quiz Book is all about brain teasers for the Python programming language. The Python Quiz Book isn't made to teach you Python. It's there to help you test your knowledge or teach you something new about the language.

The Python Quiz Book has over 100 quizzes! The book will also have a companion course on Teach Me Python.

The goal of the book is to help you be a better engineer. Some of the quizzes will be esoteric or demonstrate bad programming practices. You can learn what not to do in your own code. You will also learn neat tips and tricks about Python that you can share with your friends and coworkers.

Regardless of whether you are a beginner with Python or a seasoned programming rock-star, Michael Driscoll will help you continue to grow in your developer journey. There are hundreds of awesome tutorials on his blog, Mouse Vs Python, that you can read for free!

About the Author

Michael Driscoll
Michael Driscoll

Michael has been programming with Python since 2006. He is the author of the popular Python blog, The Mouse Vs. the Python. Michael has been a technical reviewer for Packt Publishing and No Starch Press.  He is also a contributor on Real Python.

He also co-authored The Essential Core Python Cheat Sheet for DZone.

Michael released his first book, Python 101, June 3rd, 2014. He wrote the follow up, Python 201: Intermediate Python and published it in the summer of 2016. He is also the author of wxPython Cookbook from Apress as well as Python Interviews from Packt Publishing.

Michael is currently working on some new books as well.

Michael Driscoll

Episode 47

Table of Contents

  • Introduction
    • Audience
    • About the Author
    • Conventions
    • Book Source Code
    • Reader Feedback
    • Errata
  • Quiz 1 - Exceptionally Crazy
    • The Quiz
    • Hint
  • Answer 1 - Exceptionally Crazy
    • The Answer
    • Explanation
  • Quiz 2 - Number Explosion
    • The Quiz
    • Hint
  • Answer 2 - Number Explosion
    • The Answer
    • Explanation
  • Quiz 3 - Letter Explosion
    • The Quiz
    • Hint
  • Answer 3 - Letter Explosion
    • The Answer
    • Explanation
  • Quiz 4 - Raising Exceptions
    • The Quiz
    • Hint
  • Answer 4 - Raising Exceptions
    • The Answer
    • Explanation
  • Quiz 5 - Positional Arguments
    • The Quiz
    • Hint
  • Answer 5 - Positional Arguments
    • The Answer
    • Explanation
  • Quiz 6 - Truthy or Falsey
    • The Quiz
    • Hint
  • Answer 6 - Truthy or Falsey
    • The Answer
    • Explanation
  • Quiz 7 - List Popping
    • The Quiz
    • Hint
  • Answer 7 - List Popping
    • The Answer
    • Explanation
  • Quiz 8 - Modulo List Comprehension
    • The Quiz
    • Hint
  • Answer 8 - Modulo List Comprehension
    • The Answer
    • Explanation
  • Quiz 9 - Zipping Lists
    • The Quiz
    • Hint
  • Answer 9 - Zipping Lists
    • The Answer
    • Explanation
  • Quiz 10 - Packing Variables
    • The Quiz
    • Hint
  • Answer 10 - Packing Variables
    • The Answer
    • Explanation
  • Quiz 11 - Lambdas and Bools
    • The Quiz
    • Hint
  • Answer 11 - Lambdas and Bools
    • The Answer
    • Explanation
  • Quiz 12 - Animaniacal
    • The Quiz
    • Hint
  • Answer 12 - Animaniacal
    • The Answer
    • Explanation
  • Quiz 13 - Set Subtraction
    • The Quiz
    • Hint
  • Answer 13 - Set Subtraction
    • The Answer
    • Explanation
  • Quiz 14 - Nesting Ternaries
    • The Quiz
    • Hint
  • Answer 14 - Nesting Ternaries
    • The Answer
    • Explanation
  • Quiz 15 - Type Multiplication
    • The Quiz
    • Hint
  • Answer 15 - Type Multiplication
    • The Answer
    • Explanation
  • Quiz 16 - f-string Formatting
    • The Quiz
    • Hint
  • Answer 16 - f-string Formatting
    • The Answer
    • Explanation
  • Quiz 17 - f-strings with Dates
    • The Quiz
    • Hint
  • Answer 17 - f-strings with Dates
    • The Answer
    • Explanation
  • Quiz 18 - f-string Rounding
    • The Quiz
    • Hint
  • Answer 18 - f-string Rounding
    • The Answer
    • Explanation
  • Quiz 19 - Boolean Math
    • The Quiz
    • Hint
  • Answer 19 - Boolean Math
    • The Answer
    • Explanation
  • Quiz 20 - Dictionary Explosion
    • The Quiz
    • Hint
  • Answer 20 - Dictionary Explosion
    • The Answer
    • Explanation
  • Quiz 21 - Fun with Walruses
    • The Quiz
    • Hint
  • Answer 21 - Fun with Walruses
    • The Answer
    • Explanation
  • Quiz 22 - f-string Justification
    • The Quiz
    • Hint
  • Answer 22 - f-string Justification
    • The Answer
    • Explanation
  • Quiz 23 - What’s Callable?
    • The Quiz
    • Hint
  • Answer 23 - What’s Callable?
    • The Answer
    • Explanation
  • Quiz 24 - Shadows
    • The Quiz
    • Hint
  • Answer 24 - Shadows
    • The Answer
    • Explanation
  • Quiz 25 - Dictionary Keys
    • The Quiz
    • Hint
  • Answer 25 - Dictionary Keys
    • The Answer
    • Explanation
  • Quiz 26 - List Mutation
    • The Quiz
    • Hint
  • Answer 26 - List Mutation
    • The Answer
    • Explanation
  • Quiz 27 - f-string Number Bases
    • The Quiz
    • Hint
  • Quiz 28 - Boolean Shenanigans
    • The Quiz
    • Hint
  • Answer 28 - Boolean Shenanigans
    • The Answer
    • Explanation
  • Quiz 29 - String Slicing Silliness
    • The Quiz
    • Hint
  • Answer 29 - String Slicing Silliness
    • The Answer
    • Explanation
  • Quiz 30 - Enumerate and Dictionaries
    • The Quiz
    • Hint
  • Quiz 31 - Dynamic Docstrings
    • The Quiz
    • Hint
  • Answer 31 - Dynamic Docstrings
    • The Answer
    • Explanation
  • Quiz 32 - Magical Multiplication
    • The Quiz
    • Hint
  • Answer 32 - Magical Multiplication
    • The Answer
    • Explanation
  • Quiz 34 - What Makes a Function?
    • The Quiz
    • Hint
  • Answer 34 - What Makes a Function?
    • The Answer
    • Explanation
  • Quiz 35 - More Fun with Walruses
    • The Quiz
    • Hint
  • Answer 35 - More Fun with Walruses
    • The Answer
    • Explanation
  • Quiz 36 - Dictionary Comprehension Trickery
    • The Quiz
    • Hint
  • Answer 36 - Dictionary Comprehension Trickery
    • The Answer
    • Explanation
  • Quiz 37 - Multiple Assignment Mania
    • The Quiz
    • Hint
  • Answer 37 - Multiple Assignment Mania
    • The Answer
    • Explanation
  • Quiz 38 - Exhausting Generators
    • The Quiz
    • Hint
  • Answer 38 - Exhausting Generators
    • The Answer
    • Explanation
  • Quiz 39 - A List O’ Functions
    • The Quiz
  • Answer 39 - A List O’ Functions
    • Explanation
  • Quiz 40 - Fixing the Math
    • The Quiz
    • Hint
  • Answer 40 - Fixing the Math
    • The Answer
    • Explanation
  • Quiz 41 - Runaway Characters
    • The Quiz
    • Hint
  • Answer 41 - Runaway Characters
    • The Answer
    • Explanation
  • Quiz 42 - Truthy or Falsey Take Two
    • The Quiz
    • Hint
  • Answer 42 - Truthy or Falsey Take Two
    • The Answer
    • Explanation
  • Quiz 43 - More f-string Formatting Fun
    • The Quiz
    • Hint
  • Answer 43 - More f-string Formatting Fun
    • The Answer
    • Explanation
  • Quiz 44 - Fun with Types
    • The Quiz
    • Hint
  • Answer 44 - Fun with Types
    • The Answer
    • Explanation
  • Quiz 45 - Boolean Equality
    • The Quiz
    • Hint
  • Answer 45 - Boolean Equality
    • The Answer
    • Explanation
  • Quiz 46 - Manic Multistring
    • The Quiz
    • Hint
  • Answer 46 - Manic Multistring
    • The Answer
    • Explanation

The Leanpub 60-day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Do Well. Do Good.

Authors have earned$12,124,424writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub