首页题目详情

下列关于 try-except 语句的描述中,正确的是?

题目配图
A.try-except 可以处理多个异常类型
B.try-except 必须与 else 语句一起使用
C.try-except 只能捕获一个异常类型
D.try-except 不能嵌套使用

优质解答

答案

A

解析

try-except 语句可以使用多个 except 分支来捕获不同的异常类型,如 except ValueError 和 except TypeError。

查看答案和解析

支付 ¥0.1 即可查看此题答案和详细解析

低至 ¥0.1 起

Python程序设计单选题中等AI生成