本文共 477 字,大约阅读时间需要 1 分钟。
A Python program terminates as soon as it encounters an error. In Python, an error can be a syntax error or an exception. In this course, you will see what an exception is and how it differs from a syntax error. After that, you will learn about raising exceptions and making assertions. Then, you’ll finish with a demonstration of the try and except block.
Python程序在遇到错误后立即终止。 在Python中,错误可以是语法错误或异常。 在本课程中,您将了解什么是异常以及异常与语法错误的区别。 之后,您将学习有关引发异常和声明的知识。 然后,您将完成try和except块的演示。
翻译自:
转载地址:http://kwqwd.baihongyu.com/