It is never right to give bad examples to others, even if one expects good to come from it.
给别人示范坏榜样绝对不行,就算期待结果会是良善也不行。
So when someone comes to me, and they're about to do a test, I ask them, what do you expect your program to do?
因此当很多人找到我想要,做一次实验的时候,我问他们你期待你,的程序返回什么结果呢?
It is a much scarrier idea than saying I have this, I'm going to do it, I'm going to put it down there as opposed to being open to what may come and being uncertain whether that would be something good enough.
这和,我知道了,我要做这个,我想写这个,这种确定感相比,对可能的结果保持一种开放的心态,不知道,期待能否满足的未知感相比,更挑战一些。
Does it give you the answer that you expected it to give? Often, in practical problems, you'll spend just as much time doing performance debugging. Why is it slow?
它返回了期待中的结果了么?通常,在实际的问题中你会花,同样多的时间在性能调试上,它为什么运行这么慢?
But that little short hand there is doing exactly the same thing. It is adding that value into some digits and putting it back or signing it back into some digits. And I'll walk through that loop and when I'm done I can print out the total thing does. And if I do that, I get out what I would expect.
加上得到的这个数的,但是这个缩写声明其实是进行了同样的操作,它把我们得到的这个数加到一个数上面去,然后用和对这个数进行了重新赋值,在循环中会去遍历字符串,当完成循环后,程序会显示数字的总和,如果我运行,这个程序的话,我会得到我期待的结果。
unfortunately in Python you can, however, do things like this.
很不幸在Python中你却可以这么干,不过你期待结果是什么呢?
And it sure enough prints what we expected it to print.
现在如果我显示下ivys的内容,它肯定会显示出我们期待的结果。
应用推荐