w3resource
w3resource logo

Python: ord() function

(追記) (追記ここまで)
(追記) (追記ここまで)

ord() function

The ord() function is used to get an integer representing the Unicode code point of that character.

Version:

(Python 3.2.5)

Syntax:

ord(c)

Parameter:

Name Description Required /
Optional
Type
c Any character of length 1. Required String

Return value:

Returns an integer representing the Unicode code point of the given Unicode character.

Example: Python ord() function

# code point of integer
print(ord('7'))
# code point of alphabet 
print(ord('B'))
# code point of character
print(ord('&'))

Output:

55
66
38

Python Code Editor:

[フレーム]

PREV : open()
NEXT : pow()

Test your Python skills with w3resource's quiz



Follow us on Facebook and Twitter for latest update.

(追記) (追記ここまで)


(追記) (追記ここまで)
(追記) (追記ここまで)


AltStyle によって変換されたページ (->オリジナル) /