ord()

Contents
Введение
Пример
Похожие статьи

Введение

ord(c, /) Given a string representing one Unicode character, return an integer representing the Unicode code point of that character. For example, ord('a') returns the integer 97 and ord('€') (Euro sign) returns 8364. This is the inverse of chr().

Функция ord() принимает символ и возвращает его порядковый номер в юникоде

Принимает str возвращает int

Синтаксис

ord(character)

Пример

Простейший пример

print("\t", ord("\t")) print("\n", ord("\n")) print("\r", ord("\r")) print(" ", ord(" ")) print("0 ", ord("0")) print("A ", ord("A")) print("B ", ord("B")) print("\ ", ord("\"))

\t 9 \n 10 \r 13 32 0 48 A 65 B 66 \ 92

Article author: Andrei Olegovich

Related articles
*args **kwargs
Лямбда функции
all()
any()
map()
zip()
sorted()
Функции первого класса
Замыкания
Декораторы
Кэширование
Python
if, elif, else
Циклы
Методы
enum
Banner image

Search this site

Subscribe to Telegram channel @aofeed to follow new articles and updates to old ones

Go to channel

@aofeed

Ask a question in the Telegram group

@aofeedchat

Contacts and cooperation:
I recommend our hosting beget.com
Write to info@aredel.com if you:
1. Want to write an article for our site or translate an article into your native language.
2. Want to place thematically relevant ads on the site.
3. Ads on my site pass maximum censorship. If you see an ad block unsuitable for school-age children, shocking or misleading - please contact us by e-mail
4. Found a mistake, inaccuracy, bug, etc. on the site. ... .......
5. Articles can be shared on social media by clicking a network icon: