The ord () function in Python
The built-in ord () function in Python returns an integer representing the Unicode code of the specified character.
The built-in ord () function in Python returns an integer representing the Unicode code of the specified character.
Python's ord () function syntax
ord(c)
The ord () function is the reciprocal of the function chr ().
The parameter of ord () function
ord () has a unique parameter:
c
: is any string, any character.
Value returned from ord ()
Ord () returns an integer representing the Unicode code of the specified character.
For example
# số nguyên print(ord('5')) # chữ cái print(ord('A')) # ký tự print(ord('$'))
Run the program, the result is:
53 65 36
See also: Built-in Python functions
4 ★ | 1 Vote
You should read it
- The function id () in Python
- Int () function in Python
- The function dir () in Python
- Max () function in Python
- Exec () function in Python
- Zip () function in Python
- The map () function in Python
- Sum () function in Python
- The oct () function in Python
- The delattr () function in Python
- Bin () function in Python
- The function set () in Python
Maybe you are interested
How to fix the error of missing letters when typing accented letters in Word
How to fix PDF to Word conversion error that cannot be edited
Many Samsung users found using 'samsung' as password
Crack Excel password, remove Sheet password in Excel file
Create a PowerPoint presentation from an existing Word document
How to retrieve Facebook password, recover latest account