Python Ord: пошаговое руководство

| | | |

–ú–µ—Ç–æ–¥ Python ord () –ø—Ä–µ–æ–±—Ä–∞–∑—É–µ—Ç —Å–∏–º–≤–æ–ª –≤ –µ–≥–æ –∫–æ–¥ Unicode. –ú–µ—Ç–æ–¥ ord () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –æ–¥–∏–Ω –∞—Ä–≥—É–º–µ–Ω—Ç: —Å—Ç—Ä–æ–∫—É, —Å–æ–¥–µ—Ä–∂–∞—â—É—é –æ–¥–∏–Ω —Å–∏–º–≤–æ–ª –Æ–Ω–∏–∫–æ–¥–∞. –≠—Ç–æ—Ç –º–µ—Ç–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Ü–µ–ª–æ–µ —á–∏—Å–ª–æ, –ø—Ä–µ–¥—Å—Ç–∞–≤–ª—è—é—â–µ–µ —ç—Ç–æ—Ç —Å–∏–º–≤–æ–ª –≤ –Æ–Ω–∏–∫–æ–¥–µ.

–í—ã –º–æ–∂–µ—Ç–µ —Å—Ç–æ–ª–∫–Ω—É—Ç—å—Å—è —Å —Å–∏—Ç—É–∞—Ü–∏–µ–π, –∫–æ–≥–¥–∞ –≤–∞–º –Ω—É–∂–Ω–æ –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å —Å–∏–º–≤–æ–ª –≤ —Å–æ–æ—Ç–≤–µ—Ç—Å—Ç–≤—É—é—â–∏–π –µ–º—É –∫–æ–¥ –Æ–Ω–∏–∫–æ–¥–∞. –ù–∞–ø—Ä–∏–º–µ—Ä, –≤—ã –º–æ–∂–µ—Ç–µ —Å–æ–∑–¥–∞—Ç—å —Ñ–æ—Ä–º—É –æ–±–Ω–æ–≤–ª–µ–Ω–∏—è –ø—Ä–æ—Ñ–∏–ª—è –≤ Python, –∫–æ—Ç–æ—Ä–∞—è –¥–æ–ª–∂–Ω–∞ –ø—Ä–æ–≤–µ—Ä—è—Ç—å –∫–∞–∂–¥—É—é —Å—Ç—Ä–æ–∫—É –Ω–∞ –Ω–∞–ª–∏—á–∏–µ —Å–º–∞–π–ª–∏–∫–æ–≤ –∏ –¥—Ä—É–≥–∏—Ö —Å–ø–µ—Ü–∏–∞–ª—å–Ω—ã—Ö —Å–∏–º–≤–æ–ª–æ–≤. –≠—Ç–∏ —Å–∏–º–≤–æ–ª—ã –Ω–µ–ª—å–∑—è –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –≤ —Ñ–æ—Ä–º–µ.

Python –∏–º–µ–µ—Ç –≤—Å—Ç—Ä–æ–µ–Ω–Ω—É—é —Ñ—É–Ω–∫—Ü–∏—é, –∫–æ—Ç–æ—Ä–∞—è –ø—Ä–µ–æ–±—Ä–∞–∑—É–µ—Ç —Å–∏–º–≤–æ–ª –≤ —Ü–µ–ª–æ–µ —á–∏—Å–ª–æ, –ø—Ä–µ–¥—Å—Ç–∞–≤–ª—è—é—â–µ–µ –∫–æ–¥ Unicode —Å–∏–º–≤–æ–ª–∞: ord () .

–í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –º—ã —Å–æ–±–∏—Ä–∞–µ–º—Å—è –æ–±—Å—É–¥–∏—Ç—å, –∫–∞–∫ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –º–µ—Ç–æ–¥ Python ord () –¥–ª—è –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞–Ω–∏—è —Å–∏–º–≤–æ–ª–∞ –≤ –µ–≥–æ –∫–æ–¥ Unicode. –ú—ã —Ç–∞–∫–∂–µ —Ä–∞—Å—Å–º–æ—Ç—Ä–∏–º –Ω–µ—Å–∫–æ–ª—å–∫–æ –ø—Ä–∏–º–µ—Ä–æ–≤ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏—è –º–µ—Ç–æ–¥–∞ ord () –≤ –ø—Ä–æ–≥—Ä–∞–º–º–µ Python.

Unicode Refresher

–ö–æ–º–ø—å—é—Ç–µ—Ä—ã –Ω–∞ —Ñ—É–Ω–¥–∞–º–µ–Ω—Ç–∞–ª—å–Ω–æ–º —É—Ä–æ–≤–Ω–µ, –∏–º–µ—Ç—å –¥–µ–ª–æ —Å —á–∏—Å–ª–∞–º–∏. –ë—É–∫–≤—ã, –∫–æ—Ç–æ—Ä—ã–µ –ø–æ—è–≤–ª—è—é—Ç—Å—è –Ω–∞ –∫–æ–º–ø—å—é—Ç–µ—Ä–∞—Ö, —Å–æ—Ö—Ä–∞–Ω—è—é—Ç—Å—è –∫–æ–º–ø—å—é—Ç–µ—Ä–∞–º–∏ –≤ –≤–∏–¥–µ —Å–ø–∏—Å–∫–∞ —á–∏—Å–µ–ª.

–í –ø—Ä–æ—à–ª–æ–º —Å—É—â–µ—Å—Ç–≤–æ–≤–∞–ª–∏ —Å–æ—Ç–Ω–∏ —Ä–∞–∑–ª–∏—á–Ω—ã—Ö —Å–ø–æ—Å–æ–±–æ–≤ —Ö—Ä–∞–Ω–µ–Ω–∏—è —Å–∏–º–≤–æ–ª–æ–≤. –ß–∞—Å—Ç–æ —ç—Ç–∏ –º–µ—Ç–æ–¥—ã –Ω–µ —Å–æ–¥–µ—Ä–∂–∞–ª–∏ –¥–æ—Å—Ç–∞—Ç–æ—á–Ω–æ —Å–∏–º–≤–æ–ª–æ–≤, —á—Ç–æ–±—ã –æ—Ö–≤–∞—Ç–∏—Ç—å –º–µ–∂–¥—É–Ω–∞—Ä–æ–¥–Ω—ã–µ —è–∑—ã–∫–∏ –∏–ª–∏ —Å–ø–µ—Ü–∏–∞–ª—å–Ω—ã–µ —Å–∏–º–≤–æ–ª—ã.

–í—Å–µ –∏–∑–º–µ–Ω–∏–ª–æ—Å—å –≤ 1991 –≥–æ–¥—É. –í —ç—Ç–æ–º –≥–æ–¥—É –æ—Ä–≥–∞–Ω–∏–∑–∞—Ü–∏—è –ø–æ–¥ –Ω–∞–∑–≤–∞–Ω–∏–µ–º Unicode Consortium –æ–ø—É–±–ª–∏–∫–æ–≤–∞–ª–∞ —Å—Ç–∞–Ω–¥–∞—Ä—Ç–∏–∑–∏—Ä–æ–≤–∞–Ω–Ω—É—é —Å–ø–µ—Ü–∏—Ñ–∏–∫–∞—Ü–∏—é —Ç–æ–≥–æ, –∫–∞–∫ —Å–∏–º–≤–æ–ª—ã –º–æ–≥—É—Ç –±—ã—Ç—å –ø—Ä–µ–¥—Å—Ç–∞–≤–ª–µ–Ω—ã —Å –∫–æ–º–ø—å—é—Ç–µ—Ä–∞–º–∏.

–°—Ç–∞–Ω–¥–∞—Ä—Ç Unicode –ø—Ä–µ–¥–æ—Å—Ç–∞–≤–ª—è–µ—Ç —É–Ω–∏–∫–∞–ª—å–Ω—ã–π –Ω–æ–º–µ—Ä –¥–ª—è –∫–∞–∂–¥–æ–≥–æ —Å–∏–º–≤–æ–ª–∞ –∏ –ø–æ–¥–¥–µ—Ä–∂–∏–≤–∞–µ—Ç –Ω–µ—Å–∫–æ–ª—å–∫–æ —è–∑—ã–∫–æ–≤ –∏ –≤—Å–µ —Å–ø–µ—Ü–∏–∞–ª—å–Ω—ã–µ —Å–∏–º–≤–æ–ª—ã. –°–µ–≥–æ–¥–Ω—è –µ–≥–æ –ø—Ä–∏–Ω—è–ª–∏ –≤—Å–µ —Å–æ–≤—Ä–µ–º–µ–Ω–Ω—ã–µ –ø–æ—Å—Ç–∞–≤—â–∏–∫–∏ –ø—Ä–æ–≥—Ä–∞–º–º–Ω–æ–≥–æ –æ–±–µ—Å–ø–µ—á–µ–Ω–∏—è. –ö—Ä–æ–º–µ —Ç–æ–≥–æ, —è–∑—ã–∫ Python –∏—Å–ø–æ–ª—å–∑—É–µ—Ç Unicode –¥–ª—è –ø—Ä–µ–¥—Å—Ç–∞–≤–ª–µ–Ω–∏—è —Å—Ç—Ä–æ–∫ –Ω–∞ —è–∑—ã–∫–µ –ø—Ä–æ–≥—Ä–∞–º–º–∏—Ä–æ–≤–∞–Ω–∏—è.

81% —É—á–∞—Å—Ç–Ω–∏–∫–æ–≤ –∑–∞—è–≤–∏–ª–∏, —á—Ç–æ –æ–Ω–∏ –ø–æ—á—É–≤—Å—Ç–≤–æ–≤–∞–ª–∏ —Å–µ–±—è –±–æ–ª–µ–µ —É–≤–µ—Ä–µ–Ω–Ω—ã–º–∏ –≤ —Å–≤–æ–∏—Ö –ø–µ—Ä—Å–ø–µ–∫—Ç–∏–≤–∞—Ö —Ä–∞–±–æ—Ç—ã –≤ —Ç–µ—Ö–Ω–∏—á–µ—Å–∫–∏—Ö —Å–ø–µ—Ü–∏–∞–ª–∏—Å—Ç–∞—Ö –ø–æ—Å–ª–µ –ø–æ—Å–µ—â–µ–Ω–∏—è —É—á–µ–±–Ω–æ–≥–æ –∫—É—Ä—Å–∞. –ü—Ä–æ–π–¥–∏—Ç–µ –∫—É—Ä—Å –æ–±—É—á–µ–Ω–∏—è —Å–µ–≥–æ–¥–Ω—è.

–°—Ä–µ–¥–Ω–∏–π –≤—ã–ø—É—Å–∫–Ω–∏–∫ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è –ø–æ—Ç—Ä–∞—Ç–∏–ª –º–µ–Ω–µ–µ —à–µ—Å—Ç–∏ –º–µ—Å—è—Ü–µ–≤ –Ω–∞ –ø–µ—Ä–µ—Ö–æ–¥–Ω—É—é –∫–∞—Ä—å–µ—Ä—É, –æ—Ç –Ω–∞—á–∞–ª–∞ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è –¥–æ –ø–æ–∏—Å–∫–∞ —Å–≤–æ–µ–π –ø–µ—Ä–≤–æ–π —Ä–∞–±–æ—Ç—ã.

–Æ–Ω–∏–∫–æ–¥ –ø—Ä–∏—Å–≤–∞–∏–≤–∞–µ—Ç –∫–∞–∂–¥–æ–º—É —Å–∏–º–≤–æ–ª—É, –∫–æ—Ç–æ—Ä—ã–π –º–æ–∂–µ—Ç –±—ã—Ç—å –∏–∑–æ–±—Ä–∞–∂–µ–Ω–Ω—ã–º –Ω–∞ –∫–æ–º–ø—å—é—Ç–µ—Ä–µ & mdash; –≤–∫–ª—é—á–∞—è —Å–∏–º–≤–æ–ª—ã, –ø—Ä–æ–±–µ–ª—ã –∏ —Å–º–∞–π–ª–∏–∫–∏ & mdash; —Å —É–Ω–∏–∫–∞–ª—å–Ω—ã–º –∫–æ–¥–æ–º. –≠—Ç–æ—Ç –∫–æ–¥ –ø–æ–∑–≤–æ–ª—è–µ—Ç –∫–æ–º–ø—å—é—Ç–µ—Ä–∞–º –ª–µ–≥–∫–æ –ø–æ–Ω—è—Ç—å —á–∏—Ç–∞–µ–º—ã–π —Ç–µ–∫—Å—Ç.

–ù–∞–ø—Ä–∏–º–µ—Ä, –≤–æ—Ç –∑–Ω–∞—á–µ–Ω–∏—è Unicode –¥–ª—è —Å—Ç—Ä–æ—á–Ω—ã—Ö —Å–∏–º–≤–æ–ª–æ–≤ –æ—Ç a –¥–æ e –≤ –ë–∞–∑–æ–≤—ã–π –ª–∞—Ç–∏–Ω—Å–∫–∏–π –∞–ª—Ñ–∞–≤–∏—Ç:

Python Ord ()

–ú–µ—Ç–æ–¥ Python ord () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç –∫–æ–¥ Unicode –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω–æ–≥–æ —Å–∏–º–≤–æ–ª–∞. –≠—Ç–æ –∑–Ω–∞—á–µ–Ω–∏–µ –ø—Ä–µ–¥—Å—Ç–∞–≤–ª–µ–Ω–æ –≤ –≤–∏–¥–µ —á–∏—Å–ª–∞. –í—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ç–æ–ª—å–∫–æ –º–µ—Ç–æ–¥ ord () –¥–ª—è –æ–¥–Ω–æ–≥–æ —Å–∏–º–≤–æ–ª–∞ –∑–∞ –æ–¥–∏–Ω —Ä–∞–∑.

–ù–∞–ø—Ä–∏–º–µ—Ä, —Å–∫–∞–∂–µ–º, –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø—Ä–æ–≤–µ—Ä–∏—Ç—å, –≤–∫–ª—é—á–∞–µ—Ç –ª–∏ –∫–∞–∂–¥—ã–π —Å–∏–º–≤–æ–ª –≤ —Å—Ç—Ä–æ–∫–µ —Å–ø–µ—Ü–∏–∞–ª—å–Ω—ã–π —Å–∏–º–≤–æ–ª. –í—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å ord () –¥–ª—è —ç—Ç–æ–≥–æ.

–§—É–Ω–∫—Ü–∏—è Python ord () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –æ–¥–∏–Ω –∞—Ä–≥—É–º–µ–Ω—Ç: —Å–∏–º–≤–æ–ª, –∑–Ω–∞—á–µ–Ω–∏–µ –∫–æ–¥–∞ Unicode –∫–æ—Ç–æ—Ä–æ–≥–æ –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø–æ–ª—É—á–∏—Ç—å. –§—É–Ω–∫—Ü–∏—è –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Ü–µ–ª–æ–µ —á–∏—Å–ª–æ, –ø—Ä–µ–¥—Å—Ç–∞–≤–ª—è—é—â–µ–µ –∫–æ–¥ Unicode. —Ü–µ–Ω–Ω–æ—Å—Ç—å –≤–∞—à–µ–≥–æ –ø–µ—Ä—Å–æ–Ω–∞–∂–∞ –ø–µ—Ä–µ–¥–∞–µ—Ç—Å—è –≤ —Ñ—É–Ω–∫—Ü–∏—é.

–í–æ—Ç —Å–∏–Ω—Ç–∞–∫—Å–∏—Å –¥–ª—è –º–µ—Ç–æ–¥–∞ ord ():

ord () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç —Ç–æ–ª—å–∫–æ –æ–¥–∏–Ω —Å–∏–º–≤–æ–ª. –ï—Å–ª–∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ –∑–∞–ø—É—Å—Ç–∏—Ç—å ord () –¥–ª—è –Ω–µ—Å–∫–æ–ª—å–∫–∏—Ö —Å–∏–º–≤–æ–ª–æ–≤, –≤–∞–º –Ω—É–∂–Ω–æ –±—É–¥–µ—Ç –∏–∑–≤–ª–µ—á—å –∫–∞–∂–¥—ã–π –æ—Ç–¥–µ–ª—å–Ω—ã–π —Å–∏–º–≤–æ–ª –∏–∑ —Å—Ç—Ä–æ–∫–∏ –∏ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å ord ().

ord () –ø—Ä–æ—Ç–∏–≤–æ–ø–æ–ª–æ–∂–µ–Ω –º–µ—Ç–æ–¥—É chr (). –í —Ç–æ –≤—Ä–µ–º—è –∫–∞–∫ chr () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Å–∏–º–≤–æ–ª, –∫–æ—Ä—Ä–µ–ª–∏—Ä–æ–≤–∞–Ω–Ω—ã–π —Å–æ –∑–Ω–∞—á–µ–Ω–∏–µ–º Unicode, ord () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç –∑–Ω–∞—á–µ–Ω–∏–µ Unicode –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω–æ–≥–æ —Å–∏–º–≤–æ–ª–∞.

–°—Ç–æ–∏—Ç –æ—Ç–º–µ—Ç–∏—Ç—å, —á—Ç–æ ord () —Ä–∞–±–æ—Ç–∞–µ—Ç —Å–æ –≤—Å–µ–º–∏ —Å–∏–º–≤–æ–ª–∞–º–∏ Unicode, –∞ –Ω–µ —Ç–æ–ª—å–∫–æ —Å —á–∏—Å–ª–∞–º–∏ –∏ –ø–∏—Å—å–º–∞. –í —ç—Ç–æ–º –º–µ—Ç–æ–¥–µ, –Ω–∞–ø—Ä–∏–º–µ—Ä, –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Å–∏–º–≤–æ–ª—ã.

–ü—Ä–∏–º–µ—Ä—ã ord Python

–î–∞–≤–∞–π—Ç–µ –≤–æ—Å–ø–æ–ª—å–∑—É–µ–º—Å—è –Ω–µ—Å–∫–æ–ª—å–∫–∏–º–∏ –ø—Ä–∏–º–µ—Ä–∞–º–∏, —á—Ç–æ–±—ã –ø–æ–∫–∞–∑–∞—Ç—å, –∫–∞–∫ ord () –º–æ–∂–µ—Ç –±—ã—Ç—å –∏—Å–ø–æ–ª—å–∑—É–µ—Ç—Å—è –≤ Python.

ord () –ü—Ä–∏–º–µ—Ä Python: –æ–¥–∏–Ω —Å–∏–º–≤–æ–ª

–ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, –º—ã —Å–æ–∑–¥–∞–µ–º —ç—Ç–∞–ª–æ–Ω–Ω–æ–µ –ø—Ä–∏–ª–æ–∂–µ–Ω–∏–µ, –∫–æ—Ç–æ—Ä–æ–µ —É–ø—Ä–æ—â–∞–µ—Ç –∏–∑—É—á–µ–Ω–∏–µ Unicode —à–∫–æ–ª—å–Ω–∏–∫–∞–º–∏, –∏–∑—É—á–∞—é—â–∏–º–∏ –∏–Ω—Ñ–æ—Ä–º–∞—Ç–∏–∫—É. –ù–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –æ–¥–∏–Ω —Å–∏–º–≤–æ–ª –∏ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç –∑–Ω–∞—á–µ–Ω–∏–µ –∫–æ–¥–∞ Unicode —ç—Ç–æ–≥–æ —Å–∏–º–≤–æ–ª–∞. –í–æ—Ç –∫–æ–¥, –∫–æ—Ç–æ—Ä—ã–π –º—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –¥–ª—è —Å–æ–∑–¥–∞–Ω–∏—è —Ç–∞–∫–æ–π –ø—Ä–æ–≥—Ä–∞–º–º—ã:

–ö–æ–≥–¥–∞ –º—ã –∑–∞–ø—É—Å–∫–∞–µ–º –Ω–∞—à code –∏ –≤—Å—Ç–∞–≤—å—Ç–µ –∑–Ω–∞—á–µ–Ω–∏–µ K (–≤ –≤–µ—Ä—Ö–Ω–µ–º —Ä–µ–≥–∏—Å—Ç—Ä–µ), —á–µ–π –∫–æ–¥ Unicode –º—ã —Ö–æ—Ç–∏–º –ø–æ–ª—É—á–∏—Ç—å, –º—ã –ø–æ–ª—É—á–∏–º —Å–ª–µ–¥—É—é—â–∏–π –≤—ã–≤–æ–¥:

–í –ø–µ—Ä–≤–æ–π —Å—Ç—Ä–æ–∫–µ –∫–æ–¥–∞ –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º Python input ( ) —Ñ—É–Ω–∫—Ü–∏—è , —á—Ç–æ–±—ã –∑–∞–ø—Ä–æ—Å–∏—Ç—å –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞–Ω–∏–µ —Å–∏–º–≤–æ–ª–∞ –≤ –µ–≥–æ –∫–æ–¥–æ–≤–æ–µ –∑–Ω–∞—á–µ–Ω–∏–µ Unicode. –ó–∞—Ç–µ–º –≤ —Å–ª–µ–¥—É—é—â–µ–π —Å—Ç—Ä–æ–∫–µ –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º ord () –¥–ª—è –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞–Ω–∏—è –≤–≤–æ–¥–∞ –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—è –≤ –∑–Ω–∞—á–µ–Ω–∏–µ –æ–±—ä–µ–∫—Ç–∞ Unicode.

–ú—ã —Ä–∞—Å–ø–µ—á–∞—Ç—ã–≤–∞–µ–º –∏–Ω—Å—Ç—Ä—É–∫—Ü–∏—é, –∫–æ—Ç–æ—Ä–∞—è —Å–æ–æ–±—â–∞–µ—Ç –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—é –∑–Ω–∞—á–µ–Ω–∏–µ Unicode —Å–∏–º–≤–æ–ª–∞, –∫–æ—Ç–æ—Ä—ã–π –æ–Ω–∏ –≤—Å—Ç–∞–≤–∏–ª–∏ –≤ –ø—Ä–æ–≥—Ä–∞–º–º—É. –í —ç—Ç–æ–º —Å–ª—É—á–∞–µ –∫–æ–¥–æ–≤–∞—è —Ç–æ—á–∫–∞ —Å–∏–º–≤–æ–ª–∞ —Ä–∞–≤–Ω–∞ 75, —á—Ç–æ —è–≤–ª—è–µ—Ç—Å—è –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç—Å—è –Ω–∞—à–µ–π –ø—Ä–æ–≥—Ä–∞–º–º–æ–π.

Unicode, –∫–∞–∫ –æ–±—Å—É–∂–¥–∞–ª–æ—Å—å —Ä–∞–Ω–µ–µ, –≤–∫–ª—é—á–∞–µ—Ç —á–∏—Å–ª–∞ –¥–ª—è –∫–∞–∂–¥–æ–≥–æ —Å–∏–º–≤–æ–ª–∞. –ò—Ç–∞–∫, –µ—Å–ª–∏ –±—ã –º—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–ª–∏ ord () –¥–ª—è —Å–∏–º–≤–æ–ª–∞ –ª–µ–≤–æ–π –∫–≤–∞–¥—Ä–∞—Ç–Ω–æ–π —Å–∫–æ–±–∫–∏ ( [), –Ω–∞–ø—Ä–∏–º–µ—Ä, –Ω–∞—à –∫–æ–¥ –≤–µ—Ä–Ω–µ—Ç:

ord () –ü—Ä–∏–º–µ—Ä Python: –Ω–µ—Å–∫–æ–ª—å–∫–æ —Å–∏–º–≤–æ–ª–æ–≤

–§—É–Ω–∫—Ü–∏—è ord () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç —Ç–æ–ª—å–∫–æ –æ–¥–∏–Ω —Å–∏–º–≤–æ–ª –∑–∞ —Ä–∞–∑. –í–æ—Ç —á—Ç–æ –ø—Ä–æ–∏–∑–æ–π–¥–µ—Ç, –µ—Å–ª–∏ –≤—ã –ø–µ—Ä–µ–¥–∞–¥–∏—Ç–µ –¥–≤–∞ —Å–∏–º–≤–æ–ª–∞ —á–µ—Ä–µ–∑ –º–µ—Ç–æ–¥ ord ():

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç:

–ï—Å–ª–∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø—Ä–æ–≤–µ—Ä–∏—Ç—å –∑–Ω–∞—á–µ–Ω–∏–µ Unicode –¥–ª—è –≤—Å–µ—Ö —Å–∏–º–≤–æ–ª–æ–≤ –≤ –±–æ–ª–µ–µ –¥–ª–∏–Ω–Ω–æ–π —Å—Ç—Ä–æ–∫–µ –≤–∞–º –Ω—É–∂–Ω–æ –±—É–¥–µ—Ç —Ä–∞–∑–¥–µ–ª–∏—Ç—å —Å–≤–æ—é —Å—Ç—Ä–æ–∫—É.

"–ö–∞—Ä—å–µ—Ä–Ω–∞—è –∫–∞—Ä–º–∞ –≤–æ—à–ª–∞ –≤ –º–æ—é –∂–∏–∑–Ω—å, –∫–æ–≥–¥–∞ —è –±–æ–ª—å—à–µ –≤—Å–µ–≥–æ –≤ –Ω–µ–π –Ω—É–∂–¥–∞–ª–∞—Å—å, –∏ –±—ã—Å—Ç—Ä–æ –ø–æ–º–æ–≥–ª–∞ –º–Ω–µ –ø—Ä–æ–π—Ç–∏ –∫—É—Ä—Å –æ–±—É—á–µ–Ω–∏—è. –ß–µ—Ä–µ–∑ –¥–≤–∞ –º–µ—Å—è—Ü–∞ –ø–æ—Å–ª–µ –≤—ã–ø—É—Å–∫–∞ —è –Ω–∞—à–ª–∞ —Ä–∞–±–æ—Ç—É —Å–≤–æ–µ–π –º–µ—á—Ç—ã, –∫–æ—Ç–æ—Ä–∞—è —Å–æ–æ—Ç–≤–µ—Ç—Å—Ç–≤–æ–≤–∞–ª–∞ –º–æ–∏–º —Ü–µ–Ω–Ω–æ—Å—Ç—è–º –∏ —Ü–µ–ª—è–º –≤ –∂–∏–∑–Ω–∏! "

–í–µ–Ω–µ—Ä–∞, –∏–Ω–∂–µ–Ω–µ—Ä-–ø—Ä–æ–≥—Ä–∞–º–º–∏—Å—Ç –≤ Rockbot

< p> –î–æ–ø—É—Å—Ç–∏–º, –º—ã —Å–æ–∑–¥–∞–µ–º –ø—Ä–æ–≥—Ä–∞–º–º—É, –∫–æ—Ç–æ—Ä–∞—è –ø—Ä–æ–≤–µ—Ä—è–µ—Ç, —Å–æ–¥–µ—Ä–∂–∏—Ç –ª–∏ –∏–º—è –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—è —Å–ø–µ—Ü–∏–∞–ª—å–Ω—ã–π —Å–∏–º–≤–æ–ª. –≠—Ç–æ–π –ø—Ä–æ–≥—Ä–∞–º–º–µ —Å–Ω–∞—á–∞–ª–∞ —Ç—Ä–µ–±—É–µ—Ç—Å—è –∑–Ω–∞—á–µ–Ω–∏–µ Unicode –¥–ª—è –∫–∞–∂–¥–æ–≥–æ —Å–∏–º–≤–æ–ª–∞ –≤ —Å—Ç—Ä–æ–∫–µ.

–ú—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å Python for loop –¥–ª—è –ø–µ—Ä–µ–±–æ—Ä–∞ –∫–∞–∂–¥–æ–≥–æ —Å–∏–º–≤–æ–ª–∞ –≤ –Ω–∞—à–µ–π —Å—Ç—Ä–æ–∫–µ –∏ –ø–æ–ª—É—á–µ–Ω–∏—è –µ–≥–æ –∫–æ–¥–∞ Unicode. –í–æ—Ç –∫–æ–¥ –º—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç:

–î–∞–≤–∞–π—Ç–µ —É—Ç–æ—á–Ω–∏–º. –°–Ω–∞—á–∞–ª–∞ –º—ã –æ–±—ä—è–≤–ª—è–µ–º –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é Python —Å –∏–º–µ–Ω–µ–º user_name, –∫–æ—Ç–æ—Ä—ã–π —Ö—Ä–∞–Ω–∏—Ç –∏–º—è –Ω–∞—à–µ–≥–æ –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—è. –ó–∞—Ç–µ–º –º—ã —Å–æ–∑–¥–∞–µ–º —Ü–∏–∫–ª for, –∫–æ—Ç–æ—Ä—ã–π –ø–µ—Ä–µ–±–∏—Ä–∞–µ—Ç –∫–∞–∂–¥—É—é –±—É–∫–≤—É –≤ —Å—Ç—Ä–æ–∫–µ user_name.

–ù–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –∏—Å–ø–æ–ª—å–∑—É–µ—Ç ord () , —á—Ç–æ–±—ã –ø–æ–ª—É—á–∏—Ç—å –∑–Ω–∞—á–µ–Ω–∏–µ –∫–æ–¥–∞ Unicode –¥–ª—è –∫–∞–∂–¥–æ–≥–æ —Å–∏–º–≤–æ–ª–∞ –≤ –Ω–∞—à–µ–π —Å—Ç—Ä–æ–∫–µ, –∏ —Ä–∞—Å–ø–µ—á–∞—Ç–∞—Ç—å —ç—Ç–æ –∑–Ω–∞—á–µ–Ω–∏–µ.

–ö–∞–∫ –≤–∏–¥–∏—Ç–µ, –Ω–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –ø–æ–ª—É—á–∏–ª–∞ –∑–Ω–∞—á–µ–Ω–∏—è –∫–æ–¥–∞ Unicode –¥–ª—è –∫–∞–∂–¥–æ–≥–æ —Å–∏–º–≤–æ–ª–∞ –≤ –Ω–∞—à–µ–π —Å—Ç—Ä–æ–∫–µ –∏ —Ä–∞—Å–ø–µ—á–∞—Ç–∞–ª–∞ –∏—Ö –Ω–∞ –∫–æ–Ω—Å–æ–ª–∏.

–ó–∞–∫–ª—é—á–µ–Ω–∏–µ

–ú–µ—Ç–æ–¥ ord () –≤ Python –ø—Ä–µ–æ–±—Ä–∞–∑—É–µ—Ç —Å–∏–º–≤–æ–ª –≤ –µ–≥–æ –∑–Ω–∞—á–µ–Ω–∏–µ –∫–æ–¥–∞ Unicode. –≠—Ç–æ—Ç –º–µ—Ç–æ–¥ –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –æ–¥–∏–Ω —Å–∏–º–≤–æ–ª. –í –∫–∞—á–µ—Å—Ç–≤–µ –æ—Ç–≤–µ—Ç–∞ –≤—ã –ø–æ–ª—É—á–∏—Ç–µ —á–∏—Å–ª–æ–≤–æ–µ –∑–Ω–∞—á–µ–Ω–∏–µ Unicode —Å–∏–º–≤–æ–ª–∞.

–ú–µ—Ç–æ–¥ ord () –ø–æ–ª–µ–∑–µ–Ω, –µ—Å–ª–∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø—Ä–æ–≤–µ—Ä–∏—Ç—å, —Å–æ–¥–µ—Ä–∂–∏—Ç –ª–∏ —Å—Ç—Ä–æ–∫–∞ —Å–ø–µ—Ü–∏–∞–ª—å–Ω—ã–µ —Å–∏–º–≤–æ–ª—ã. –≠—Ç–æ —Å–≤—è–∑–∞–Ω–æ —Å —Ç–µ–º, —á—Ç–æ –∫–∞–∂–¥—ã–π —Å–∏–º–≤–æ–ª –∏–º–µ–µ—Ç –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω–æ–µ –∑–Ω–∞—á–µ–Ω–∏–µ Unicode. –≠—Ç–∏ –∑–Ω–∞—á–µ–Ω–∏—è –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –¥–ª—è —Å—Ä–∞–≤–Ω–µ–Ω–∏—è, —è–≤–ª—è–µ—Ç—Å—è –ª–∏ –∫–æ–Ω–∫—Ä–µ—Ç–Ω—ã–π —Å–∏–º–≤–æ–ª –±—É–∫–≤–µ–Ω–Ω–æ-—Ü–∏—Ñ—Ä–æ–≤—ã–º –∏–ª–∏ –Ω–µ—Ç. - —ç—Ç–æ –æ—Å–æ–±—ã–π —Å–∏–º–≤–æ–ª.

–•–æ—Ç–∏—Ç–µ —É–∑–Ω–∞—Ç—å –±–æ–ª—å—à–µ –æ Python? –û–∑–Ω–∞–∫–æ–º—å—Ç–µ—Å—å —Å –Ω–∞—à–∏–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–æ–º –ø–æ –∏–∑—É—á–µ–Ω–∏—é Python . –í—ã –Ω–∞–π–¥–µ—Ç–µ –ø–æ–ª–µ–∑–Ω—ã–µ —Å–æ–≤–µ—Ç—ã –ø–æ –∏–∑—É—á–µ–Ω–∏—é Pyth. –≤ —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ, —á—Ç–æ–±—ã –≤—ã –º–æ–≥–ª–∏ –Ω–∞–º–µ—Ç–∏—Ç—å —Å–≤–æ–π –ø—É—Ç—å –∫ —Ç–æ–º—É, —á—Ç–æ–±—ã —Å—Ç–∞—Ç—å –º–∞—Å—Ç–µ—Ä–æ–º Python.