July 01, 2020
Let's see: Global pandemic, check. Murder hornets, check. Saharan dust plume, check. Python Brain Teasers—hey, that's actually a fun one!
Maybe it sounds as unusual as a dust storm from the Sahara, but these brain teasers will help you level up your Python knowledge. Read on for details!
Python Brain Teasers: Exercise Your Mind
Each chapter presents a short Python program and asks you to guess the output. The possible answers can be:
- Syntax error
- Some output (e.g.,
[1 2 3])
There's a lot of research showing that people who make mistakes during the learning process learn better than people who don't. If you use this approach at work when fixing bugs, you'll find you enjoy bug hunting more and become a better developer after each bug you fix.
Before moving on to the answer and the explanation, go ahead and guess the output. After guessing the output, run the code and see the output yourself, then proceed to read the solution and the explanation. Miki Tebeka has been teaching programming for many years and finds this course of action to be highly effective.
Now available from pragprog.com/titles/d-pybrain.
This work was written and produced entirely by the author. We are proud to be distributing it.
You Could Be a Published Author
Is there a tech topic you are deeply passionate about and want to share with the rest of us? You could become a published Pragmatic Bookshelf author! Take a look at our pragprog.com/become-an-author page for details, including our 50% royalty (yes, for real!) and world-class development editors.
Don't Get Left Out
Are your friends jealous that you get these spiffy email newsletters and they don't? Clue them in that all they need to do is signup at pragprog.com.
Tell your friends! Tweet this
Follow us on Twitter for the latest news, commentary, and occasional discounts:: @pragprog, Andy Hunt @PragmaticAndy.
Thanks for your continued support,
Publisher, Pragmatic Bookshelf
By Professional Developers, for Professional Developers
Sent by the Pragmatic Programmers, LLC. • 9650 Strickland Rd Ste 103-255• Raleigh NC 27615