
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to Find ASCII Value of Character using Python?
The ord function in python gives the ordinal value of a character(ASCII). You can use this function to find the ascii codes as follows
Example
s = "Hello" for c in s: print(ord(c))
Output
This will give the output
72 101 108 108 111
- Related Articles
- C++ Program to Find ASCII Value of a Character
- Find the ASCII value of the uppercase character ‘A’ using implicit conversion in C language?
- Java program to print ASCII value of a particular character
- How to convert an integer to an ASCII value in Python?
- Java Program to check whether the entered value is ASCII 7-bit control character
- ASCII art using Python pyfiglet module
- Convert an int to ASCII character in C/C++
- Posix character classes p{ASCII} Java regex.
- How to convert a single character to its integer value in Python?
- Convert between binary and ASCII using Python (binascii)
- Java Program to check whether the entered character is ASCII 7 bit numeric and character
- How to delete a character from a string using python?
- PHP – How to return character by Unicode code point value using mb_chr()?
- Java Program to check whether the character is ASCII 7 bit
- Python program to find the sum of Characters ascii values in String List

Advertisements