Python Brain Teasers: Exercise Your Mind
暫譯: Python 腦筋急轉彎:鍛鍊你的思維

Tebeka, Miki

  • 出版商: Pragmatic Bookshelf
  • 出版日期: 2021-09-28
  • 售價: $970
  • 貴賓價: 9.5$922
  • 語言: 英文
  • 頁數: 118
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1680509004
  • ISBN-13: 9781680509007
  • 相關分類: Python程式語言
  • 立即出貨 (庫存=1)

買這商品的人也買了...

商品描述

We geeks love puzzles and solving them. The Python programming language is a simple one, but like all other languages it has quirks. This book uses those quirks as teaching opportunities via 30 simple Python programs that challenge your understanding of Python. The teasers will help you avoid mistakes, see gaps in your knowledge, and become better at what you do. Use these teasers to impress your co-workers or just to pass the time in those boring meetings. Teasers are fun!

At the beginning of each chapter I'll show you a short Python program and will ask you to guess the output. The possible answers can be:

  • Syntax error
  • Exception
  • Hang
  • Some output (e.g. [1 2 3] )

Here's how to approach the puzzles. Read through the code. 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. Finally proceed to read the solution and the explanation. The puzzles are short enough to solve on a coffee break, so carry them with you, have fun, and share them with co-workers.

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.

Many of these puzzles are from the author's lessons learned (and others) of shipping bugs to production. He often uses the puzzles as quizzes during conferences and meetups, and they tend to create a buzz of excitement.

What You Need:

  • You need to know Python at some level and have experience programming with it.
  • NOTE: The book uses Python version 3.8.2 to run the code; the output _could_ change in future versions.
  • You will need a working Python environment, you can download it from python.org: https: //www.python.org/downloads/.
  • You will probably want a good IDE for python, two of the most popular ones are Visual Studio Code: https: //code.visualstudio.com/ and PyCharm: https: //www.jetbrains.com/pycharm/.

商品描述(中文翻譯)

我們這些極客喜歡解謎和解決問題。Python 程式語言是一種簡單的語言,但和所有其他語言一樣,它也有一些特性。本書利用這些特性作為教學機會,透過 30 個簡單的 Python 程式來挑戰你對 Python 的理解。這些謎題將幫助你避免錯誤,發現知識的空白,並讓你在所做的事情上變得更好。利用這些謎題來給同事留下深刻印象,或僅僅是在那些無聊的會議中打發時間。謎題是有趣的!

在每一章的開始,我會展示一個簡短的 Python 程式,並請你猜測輸出結果。可能的答案有:
- 語法錯誤
- 異常
- 停滯
- 一些輸出(例如 [1 2 3])

以下是解謎的方法。仔細閱讀程式碼。在進入答案和解釋之前,先猜測輸出結果。在猜測輸出後,運行程式碼並親自查看輸出。最後,繼續閱讀解答和解釋。這些謎題足夠簡短,可以在咖啡休息時解決,所以隨身攜帶,享受樂趣,並與同事分享。

在學習過程中犯錯的人比不犯錯的人學得更好。如果你在工作中修復錯誤時採用這種方法,你會發現自己更享受尋找錯誤的過程,並在每次修復錯誤後成為更好的開發者。

這些謎題中的許多來自作者的經驗教訓(以及其他人)在生產環境中發佈錯誤。他經常在會議和聚會中使用這些謎題作為測驗,並且它們往往會引起一陣興奮的熱潮。

你需要的:
- 你需要在某種程度上了解 Python,並有使用它編程的經驗。
- 注意:本書使用 Python 版本 3.8.2 來運行程式碼;未來版本的輸出可能會改變。
- 你需要一個可運行的 Python 環境,可以從 python.org 下載:https://www.python.org/downloads/。
- 你可能會想要一個好的 Python IDE,兩個最受歡迎的選擇是 Visual Studio Code:https://code.visualstudio.com/ 和 PyCharm:https://www.jetbrains.com/pycharm/。

作者簡介

Miki has a passion for teaching and mentoring. He teaches many workshops on various technical subjects all over the world and also mentored many young developers on their way to success. Miki is involved in open source, has several projects of his own, and contributed to several more - including the Python project. He has been using Python for more than 23 years.

作者簡介(中文翻譯)

Miki 對教學和指導充滿熱情。他在全球各地教授許多技術主題的工作坊,並且指導了許多年輕開發者走向成功。Miki 參與開源,擁有幾個自己的專案,並且對幾個其他專案做出了貢獻,包括 Python 專案。他已經使用 Python 超過 23 年。