[Python] Change the alphabet to numbers

Introduction

Write a method that you can use when you want to turn the alphabet into letters when writing a program.

Alphabet → numbers

use ord

>>> ord('a')
97

The number corresponding to the alphabet is output by ord ('alphabet').

Numbers → alphabet

use chr

>>> chr(97)
'a'

The alphabet corresponding to the number is output by chr (number).

Recommended Posts

[Python] Change the alphabet to numbers
[Python] How to change the date format (display format)
How to change Python version
[Python] Change the Cache-Control of the object uploaded to Cloud Storage
Leave the troublesome processing to Python
[python] Change the image file name to a serial number
Change the Flyweight pattern to Pythonic (?) (3)
Change the Flyweight pattern to Pythonic (?) (2)
Change the standard output destination to a file in Python
Change python default encoding to utf-8
In the python command python points to python3.8
How to get the Python version
Change the Python version of Homebrew
[Python] How to import the library
[Python] Convert natural numbers to ordinal numbers
Convert decimal numbers to n-ary numbers [python]
Did not change from Python 2 to 3
How to change the log level of Azure SDK for Python
Feel free to change the label of the legend in Seaborn in python
Change the length of Python csv strings
Script to change the description of fasta
Python amateurs try to summarize the list ①
Python> Output numbers from 1 to 100, 501 to 600> For csv
The road to compiling to Python 3 with Thrift
Updated to Python 2.7.9
Divide the dataset (ndarray) into arbitrary proportions with NumPy
The story of Python and the story of NaN
[Python] Change the alphabet to numbers
"Backport" to python 2
The fastest way for beginners to master Python
Introduction to Python Let's prepare the development environment
Python constants like None (according to the reference)
Try to solve the Python class inheritance problem
Just add the python array to the json data
Specify the Python executable to use with virtualenv
To dynamically replace the next method in python
Say hello to the world with Python with IntelliJ
Draw graphs in Julia ... Leave the graphs to Python
Change the decimal point of logging from, to.
Excel X Python The fastest way to work
The easiest way to use OpenCV with python
The trick to write flatten concisely in python
[Algorithm x Python] How to use the list
Use the Python framework "cocotb" to test Verilog.
How to erase the characters output by Python
Introduction to Python with Atom (on the way)
[Introduction to Algorithm] Find the shortest path [Python3]
A python amateur tries to summarize the list ②
[Python] I will upload the FTP to the FTP server.
[Python] Throw a message to the slack channel
An article summarizing the pitfalls addicted to python
I want to display the progress in Python!
Easy way to check the source of Python modules
[Python] How to remove duplicate values from the list
How to retrieve the nth largest value in Python
Python interpreter prompt change
I tried to graph the packages installed in Python
The wall of changing the Django service from Python 2.7 to Python 3
How to get the variable name itself in python
Think about how to program Python on the iPad
[Python] Convert decimal numbers to binary numbers, octal numbers, and hexadecimal numbers
Try to solve the programming challenge book with python3
Template of python script to read the contents of the file