---
title: "Discussion on \"Python3 异常处理\" | Hashnode"
description: "Discussion on \"Python3 异常处理\". Python3 异常处理\n一、核心概念：错误 vs 异常\n\n\n\n类别\n标识特征\n触发阶段\n典型示例\n处理方式\n\n\n\n语法错误（Syntax Error）\n编译期错误，程序无法运行\n代码解析阶段（运行前）\n缺少冒号：if 1>0 print(\"err\")；缩进错误：def f():print(\"err\")；括号不匹配：print(\"hello\")\n备注：直接修正语法，严格遵循Python规范（如冒号"
url: "https://hashnode.com/posts/python-yichangchuli/6a23a72a8f8be6022c7a71ef"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Python3 异常处理](https://tianchuangya.cc/python-yichangchuli?utm_source=hashnode&utm_medium=feed)

Python3 异常处理 一、核心概念：错误 vs 异常 类别 标识特征 触发阶段 典型示例 处理方式 语法错误（Syntax Error） 编译期错误，程序无法运行 代码解析阶段（运行前） 缺少冒号：if 1>0 print("err")；缩进错误：def f():print("err")；括号不匹配：print("hello") 备注：直接修正语法，严格遵循Python规范（如冒号

Jun 6 · 4 min read · tianchuangya.cc  
Read the article

## Written by

[tianchuangya](https://hashnode.com/@shitianchuangya)

@shitianchuangya · China

  
[View profile](https://hashnode.com/@shitianchuangya)

确定性是机器的底层逻辑，而你是我在这个绝对理性世界里，唯一的那个浪漫bug

确定性世界里，一个被允许的异常

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
