0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【python】アルファベットを数字に変更

Posted at

はじめに

プログラムを書く時にアルファベットを文字にしたいと思ったときに使える方法を書く。

アルファベット→数字

ordを使う

>>> ord('a')
97

ord('アルファベット')でアルファベットに対応した数字が出力される。

数字→アルファベット

chrを使う

>>> chr(97)
'a'

chr(数字)で数字に対応したアルファベットが出力される。

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?