assert One of the most important things we do is we use assert statements so that we catch problems early.
要学会利用,声明来早点发现问题。
And that does two things: bug one, it helps catch bugs in your code, and secondly it often converts it into a more efficient sequence of instructions before you actually go off and run it. All right?
这有两点好处:,第一是可以帮助你发现程序中的,第二是把你的代码,在运行之前,转换为更有效率的指令的集合,对不对?
And the catch is, you can only defend one of these two routes.
问题是你只能防守二者之一
Let's see who can catch this one.
看看谁能接住这个
Notice if I'm going to have two different sub problems I need to have two base cases here to catch this. And if I only had one it would error out. And as a consequence, I can go off and ask about rabbits. Let's see.
我需要定义两个基础事件来处理它,如果我只有一个基础事件的话就会产生错误,这样我就能够知道到底有多少只兔子了,让我们来看看,在第12个月末,没那么简单,在第二年末兔子就很多了。
应用推荐