Python3基础教程
Python3条件控制
## if 语句 if condition_1: statement_block_1 elif condition_2: statement_block_2 else: statement_block_3 ## if 嵌套 if 表达式1: 语句 if 表达式2: 语句 elif 表达式3: 语句 else: 语句 elif 表达式4: 语句 else: 语句 ## match...case def http_error(status): match status: case 400: return "Bad request" case 404: return "Not found" case 418: return "I'm a teapot" case _: #_ 可以匹配一切 return "Something's wrong with the internet" mystatus=400 print(http_error(400))
顶部
收展
底部
[TOC]
目录
Python 环境搭建
Python3基础语法
Python3基本数据类型
Python3运算符
Python3数字(Number)
Python3字符串
Python3列表
Python3元组
Python3字典
Python3集合
Python3条件控制
Python3循环语句
Python推导式
Python3迭代器与生成器
Python3函数
Python3模块
Python3输入和输出
Python3数据结构
Python3读和写文件
Python3 OS 文件/目录方法
Python3错误和异常
相关推荐
Python爬虫