W
W
WS_Gleb_Sirius2021-04-25 12:18:09
Python
WS_Gleb_Sirius, 2021-04-25 12:18:09

Ord() and chr() in Python! How to use Windows and KOI-8?

The Python programming language has the chr() and ord() functions. They allow you to translate a character into its code and vice versa according to the Unicode code table. And how to use these functions for code tables KOI-8 and Windows?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
longclaps, 2021-04-25
@longclaps

These functions are not.

for i in range(0x0410, 0x0450):
    print(chr(i), end='')
print()
for i in range(192, 256):
    print(bytes([i]).decode('KOI8-R'), end='')
Is the difference clear?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question