---
title: "How can I convert a character to a integer in Python, and viceversa?"
author: "standalone"
date: "2015-10-27T14:38:04Z"
tags: []
categories: ["编程语言"]
slug: "how-can-i-convert-a-character-to-a-integer-in-python-and-viceversa"
draft: false
lastmod: "2015-10-27T14:38:04Z"
id: 2252447
url: "https://standalone.iteye.com/blog/2252447"
---

Use chr() and ord():

>>> chr(97)
'a'
>>> ord('a')
97