020第11章 TESTING YOUR CODE_續2_optional
💛20230120晨讀感言:
💔連續幾日的練習,對於 markdown 語法下,安插 Code區塊 並讓 `^` block 可以正常的連結, 已達到熟練的地步。不過為了安全起見,我還是會在 安插 完成後,做一個簡單的測試。
💔對於 function 裡 的 str parameter,給予一個 空字串,再搭配 if 句型,就很容易 完成一個 具有optional 的 參數 (如下圖)。
💛晨讀摘要:
💚213 Responding to a Failed Test:What do you do when a test fails? Assuming you’re checking the right con- ditions, a passing test means the function is behaving correctly and a fail- ing test means there’s an error in the new code you wrote. So when a test fails, don’t change the test. Instead, fix the code that caused the test to fail. Examine the changes you just made to the function, and figure out how those changes broke the desired behavior.
from :《python crash course》
Like my work? Don't forget to support and clap, let me know that you are with me on the road of creation. Keep this enthusiasm together!
- Author
- More