Categories
Python Answers

How to get the ASCII value of a character with Python?

Spread the love

Sometimes, we want to get the ASCII value of a character with Python.

In this article, we’ll look at how to get the ASCII value of a character with Python.

How to get the ASCII value of a character with Python?

To get the ASCII value of a character with Python, we can use the ord function.

For instance, we write

n = ord('a')

to return the ASCII value of 'a' with ord.

Conclusion

To get the ASCII value of a character with Python, we can use the ord function.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *