LabEx
Python 速查表 PDF

简介

  • 入门指南

速查表

  • 基础
  • 内置函数
  • 控制流
  • 函数
  • 列表和元组
  • 字典
  • 集合
  • 推导式
  • 字符串操作
  • 字符串格式化
  • 正则表达式
  • 文件和目录路径
  • 读写文件
  • JSON 和 YAML
  • 异常处理
  • 调试
  • Args 和 kwargs
  • 装饰器
  • 上下文管理器
  • 面向对象编程
  • 数据类
  • Packaging
  • 主程序:顶层脚本
  • 虚拟环境

标准库

  • Copy
  • CSV
  • Datetime
  • Itertools
  • JSON
  • OS
  • Pathlib
  • Random
  • Shelve
  • Subprocess
  • Zipfile

内置函数

  • abs
  • aiter
  • all
  • any
  • ascii
  • bin
  • bool
  • breakpoint
  • bytearray
  • bytes
  • callable
  • chr
  • classmethod
  • compile
  • complex
  • delattr
  • dict
  • dir
  • divmod
  • enumerate
  • eval
  • exec
  • filter
  • float
  • format
  • frozenset
  • getattr
  • globals
  • hasattr
  • hash
  • help
  • hex
  • id
  • import
  • input
  • int
  • isinstance
  • issubclass
  • iter
  • len
  • list
  • locals
  • map
  • max
  • memoryview
  • min
  • next
  • object
  • oct
  • open
  • ord
  • pow
  • print
  • property
  • range
  • repr
  • reversed
  • round
  • set
  • setattr
  • slice
  • sorted
  • staticmethod
  • str
  • sum
  • super
  • tuple
  • type
  • vars
  • zip

Python ord() 内置函数

来自 Python 3 文档

给定一个表示单个 Unicode 字符的字符串,返回表示该字符 Unicode 码点的整数。

简介

ord() 函数是 chr() 的逆函数。它接受一个单字符字符串并返回其 Unicode 码点,该码点是一个整数。

示例

# 获取字符的 Unicode 码点
print(ord('A'))
print(ord('€'))
print(ord('1'))
print(ord('a'))
65
8364
49
97

相关链接

  • 速查表:操作字符串
  • 博客:Python 数据类型
  • chr()
  • ascii()
下一页Changelog
Python 速查表仓库博客
更多速查表

On this page