User:Manetta/Prototyping-SI21: Difference between revisions
(Created page with "<syntaxhighlight lang=python> for i in range(128): chr(i) </syntaxhighlight>") |
No edit summary |
||
Line 1: | Line 1: | ||
==Unicode in Python3== | |||
<blockquote> | |||
One-character Unicode strings can also be created with the chr() built-in function, which takes integers and returns a Unicode string of length 1 that contains the corresponding code point. The reverse operation is the built-in ord() function that takes a one-character Unicode string and returns the code point value. | |||
https://docs.python.org/3/howto/unicode.html | |||
</blockquote> | |||
<syntaxhighlight lang=python> | <syntaxhighlight lang=python> | ||
for i in range(128): | for i in range(128): | ||
chr(i) | chr(i) | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 08:43, 25 April 2023
Unicode in Python3
One-character Unicode strings can also be created with the chr() built-in function, which takes integers and returns a Unicode string of length 1 that contains the corresponding code point. The reverse operation is the built-in ord() function that takes a one-character Unicode string and returns the code point value. https://docs.python.org/3/howto/unicode.html
for i in range(128):
chr(i)