If I do this, try and get the 10th element of a list that's only eight long. I get what looks like an error, but it's actually throwing an exception.
如果我来这么做,试着去取长度为8的列表的第十个元素,我貌似能得到一个错误。
So generally, if you don't get an error message in a command line environment like this, that's good.
一般来说,如果你在命令行界面,没有收到错误信息,那就是好消息。
I'm much better having an exception get handled at the time of input than to let that prop -- that value rather propagate through a whole bunch of code until eventually it hits an error 17 calls later, and you have no clue where it came from.
不是我期望的格式,这时我最好有一个异常处理,而不是让其传下去,这个值传到代码的整个分支,最终会导致一个错误17调用的发生,并且你不知道这个错误是哪里来的。
> David: An error message of some sort like "file not found" or "commands not found."
>,大卫:会出现一个错误信息像“没找到文件“,或“没找到命令“
> An error.
>,会发生错误。
So this is a classic error. I've not made a copy of the list. I've got an alias of the list.
这是个相当经典的错误,在这里我并没有得到数组的。
That says it's in here. It's in this tri-block. It raised an exception, but it wasn't and I O error.
这在这里它是一个try程序块,它报出异常,但他不是io错误。
An exception is called a name error exception.
一个被称作命名错误的异常。
Give you an example of a syntax error.
返回了一个语法错误的例子。
应用推荐