Строковые методы Python: пошаговое руководство

–í Python –µ—Å—Ç—å –º–Ω–æ–≥–æ –º–µ—Ç–æ–¥–æ–≤, –∏—Å–ø–æ–ª—å–∑—É–µ–º—ã—Ö –∏—Å–∫–ª—é—á–∏—Ç–µ–ª—å–Ω–æ –¥–ª—è —Å—Ç—Ä–æ–∫. –°—Ç—Ä–æ–∫–æ–≤—ã–µ –º–µ—Ç–æ–¥—ã Python –≤–∫–ª—é—á–∞—é—Ç upper (), lower (), capitalize (), title () –∏ –¥—Ä—É–≥–∏–µ. . –≠—Ç–∏ —Å—Ç—Ä–æ–∫–æ–≤—ã–µ –º–µ—Ç–æ–¥—ã –ø–æ–ª–µ–∑–Ω—ã –¥–ª—è –º–∞–Ω–∏–ø—É–ª–∏—Ä–æ–≤–∞–Ω–∏—è, —Ä–µ–¥–∞–∫—Ç–∏—Ä–æ–≤–∞–Ω–∏—è –∏ —Ä–∞–±–æ—Ç—ã —Å–æ —Å—Ç—Ä–æ–∫–∞–º–∏.

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

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

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

String Refresher

–°—Ç—Ä–æ–∫–∏ –ø–æ–∑–≤–æ–ª—è—é—Ç —Å–æ—Ö—Ä–∞–Ω—è—Ç—å —Ç–µ–∫—Å—Ç –ø—Ä–∏ –ø—Ä–æ–≥—Ä–∞–º–º–∏—Ä–æ–≤–∞–Ω–∏–∏ –∏ –æ–±—ä—è–≤–ª—è—é—Ç—Å—è –≤ –æ–¥–∏–Ω–∞—Ä–Ω—ã—Ö –∫–∞–≤—ã—á–∫–∞—Ö " & rsquo ; –∏–ª–∏ –¥–≤–æ–π–Ω—ã–µ –∫–∞–≤—ã—á–∫–∏ " " –≤ Python. –•–æ—Ç—è –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –∫–∞–∫ –æ–¥–∏–Ω–∞—Ä–Ω—ã–µ, —Ç–∞–∫ –∏ –¥–≤–æ–π–Ω—ã–µ –∫–∞–≤—ã—á–∫–∏, –∫–æ–≥–¥–∞ –≤—ã —Ä–µ—à–∏—Ç–µ, –∫–∞–∫–∏–µ –∏–∑ –Ω–∏—Ö –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å, –≤—ã –¥–æ–ª–∂–Ω—ã –ø–æ–¥–¥–µ—Ä–∂–∏–≤–∞—Ç—å –∏—Ö —Å–æ–≥–ª–∞—Å–æ–≤–∞–Ω–Ω–æ—Å—Ç—å –≤–æ –≤—Å–µ–π –ø—Ä–æ–≥—Ä–∞–º–º–µ. –í–æ—Ç –ø—Ä–∏–º–µ—Ä –æ–±—ä—è–≤–ª–µ–Ω–∏—è —Å—Ç—Ä–æ–∫–∏:

–ú—ã –º–æ–∂–µ–º —Ä–∞—Å–ø–µ—á–∞—Ç–∞—Ç—å —Å—Ç—Ä–æ–∫—É —Å –ø–æ–º–æ—â—å—é —Ñ—É–Ω–∫—Ü–∏–∏ print ():

–ù–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç: –≠—Ç–æ –ø—Ä–∏–º–µ—Ä —Å—Ç—Ä–æ–∫–∏!

–ö–æ–≥–¥–∞ –≤—ã —Ä–∞–±–æ—Ç–∞–µ—Ç–µ —Å–æ —Å—Ç—Ä–æ–∫–æ–π, –≤—ã –º–æ–∂–µ—Ç–µ –æ–±—ä–µ–¥–∏–Ω–∏—Ç—å –µ–µ —Å –¥—Ä—É–≥–æ–π —Å—Ç—Ä–æ–∫–æ–π, —á—Ç–æ–±—ã —Å–æ–∑–¥–∞—Ç—å –Ω–æ–≤—É—é. –í –ø—Ä–æ–≥—Ä–∞–º–º–∏—Ä–æ–≤–∞–Ω–∏–∏ –º—ã –Ω–∞–∑—ã–≤–∞–µ–º —ç—Ç–æ –∫–æ–Ω–∫–∞—Ç–µ–Ω–∞—Ü–∏–µ–π —Å—Ç—Ä–æ–∫. –ß—Ç–æ–±—ã –æ–±—ä–µ–¥–∏–Ω–∏—Ç—å –¥–≤–µ —Å—Ç—Ä–æ–∫–∏, –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º –æ–ø–µ—Ä–∞—Ç–æ—Ä +. –í–æ—Ç –ø—Ä–∏–º–µ—Ä —Ñ—É–Ω–∫—Ü–∏–∏ print (), –∫–æ—Ç–æ—Ä–∞—è –æ–±—ä–µ–¥–∏–Ω—è–µ—Ç –¥–≤–µ —Å—Ç—Ä–æ–∫–∏ –≤–º–µ—Å—Ç–µ:

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

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

–ù–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç: ExampleString. –û–±—Ä–∞—Ç–∏—Ç–µ –≤–Ω–∏–º–∞–Ω–∏–µ, —á—Ç–æ –∫–æ–≥–¥–∞ –º—ã –æ–±—ä–µ–¥–∏–Ω—è–µ–º –Ω–∞—à–∏ —Å—Ç—Ä–æ–∫–∏, –ø—Ä–æ–±–µ–ª—ã –Ω–µ –≤–∫–ª—é—á–∞—é—Ç—Å—è. –ï—Å–ª–∏ –º—ã —Ö–æ—Ç–∏–º –≤–∫–ª—é—á–∏—Ç—å –ø—Ä–æ–±–µ–ª, –º—ã –¥–æ–ª–∂–Ω—ã –¥–æ–±–∞–≤–∏—Ç—å —Å–∏–º–≤–æ–ª –ø—Ä–æ–±–µ–ª–∞ –≤ –Ω–∞—à–∏ —Å—Ç—Ä–æ–∫–∏.

–¢–µ–ø–µ—Ä—å, –∫–æ–≥–¥–∞ –º—ã –∏–∑—É—á–∏–ª–∏ –æ—Å–Ω–æ–≤—ã —Å—Ç—Ä–æ–∫, –º—ã –º–æ–∂–µ–º –ø—Ä–∏—Å—Ç—É–ø–∏—Ç—å –∫ –∏–∑—É—á–µ–Ω–∏—é —Å—Ç—Ä–æ–∫–æ–≤—ã—Ö –º–µ—Ç–æ–¥–æ–≤ Python.

–°—Ç—Ä–æ–∫–∏ –≤ –≤–µ—Ä—Ö–Ω–µ–º –∏ –Ω–∏–∂–Ω–µ–º —Ä–µ–≥–∏—Å—Ç—Ä–µ

–î–≤–µ –∏–∑ –Ω–∞–∏–±–æ–ª–µ–µ —Ä–∞—Å–ø—Ä–æ—Å—Ç—Ä–∞–Ω–µ–Ω–Ω—ã—Ö —Å—Ç—Ä–æ–∫–æ–≤—ã—Ö —Ñ—É–Ω–∫—Ü–∏–π –≤ Python - —ç—Ç–æ —Ç–µ, –∫–æ—Ç–æ—Ä—ã–µ –ø–æ–∑–≤–æ–ª—è—é—Ç –≤–∞–º –∏–∑–º–µ–Ω—è—Ç—å —Ä–µ–≥–∏—Å—Ç—Ä –≤–∞—à–∏—Ö —Å—Ç—Ä–æ–∫ –Ω–∞ –≤–µ—Ä—Ö–Ω–∏–π –∏–ª–∏ –Ω–∏–∂–Ω–∏–π —Ä–µ–≥–∏—Å—Ç—Ä. –§—É–Ω–∫—Ü–∏–∏ upper () –∏ lower () –≤–µ—Ä–Ω—É—Ç —Å—Ç—Ä–æ–∫—É —Å–æ –≤—Å–µ–º–∏ –∏—Å—Ö–æ–¥–Ω—ã–º–∏ –±—É–∫–≤–∞–º–∏ –≤ —Å—Ç—Ä–æ–∫–µ, –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞–Ω–Ω—ã–º–∏ –≤ –≤–µ—Ä—Ö–Ω–∏–π –∏–ª–∏ –Ω–∏–∂–Ω–∏–π —Ä–µ–≥–∏—Å—Ç—Ä.

–ü—Ä–∏ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏–∏ —Ñ—É–Ω–∫—Ü–∏–π upper () –∏–ª–∏ lower () –≤–æ–∑–≤—Ä–∞—â–µ–Ω–Ω–∞—è —Å—Ç—Ä–æ–∫–∞ –±—É–¥–µ—Ç –Ω–æ–≤–æ–π —Å—Ç—Ä–æ–∫–æ–π, –∞ —Å—É—â–µ—Å—Ç–≤—É—é—â–∞—è —Å—Ç—Ä–æ–∫–∞ –æ—Å—Ç–∞–Ω–µ—Ç—Å—è –ø—Ä–µ–∂–Ω–µ–π.

< p> –í–æ—Ç –ø—Ä–∏–º–µ—Ä –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏—è –∫–ª–∞—Å—Å–∞ upper () –¥–ª—è –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞–Ω–∏—è —Å—Ç—Ä–æ–∫–∏ –≤ –≤–µ—Ä—Ö–Ω–∏–π —Ä–µ–≥–∏—Å—Ç—Ä:

–ù–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç:

–ï—Å–ª–∏ –º—ã —Ö–æ—Ç–∏–º, —á—Ç–æ–±—ã –Ω–∞—à–∞ —Å—Ç—Ä–æ–∫–∞ –æ—Ç–æ–±—Ä–∞–∂–∞–ª–∞—Å—å –≤ –Ω–∏–∂–Ω–µ–º —Ä–µ–≥–∏—Å—Ç—Ä–µ, –º—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å lower () —Ä–∞–±–æ—Ç–∞–µ—Ç —Å–ª–µ–¥—É—é—â–∏–º –æ–±—Ä–∞–∑–æ–º:

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

–ö—Ä–æ–º–µ —Ç–æ–≥–æ, –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å capita lize () –¥–ª—è –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏—è –∑–∞–≥–ª–∞–≤–Ω–æ–π –±—É–∫–≤—ã –≤ –ø–µ—Ä–≤–æ–º —Å–∏–º–≤–æ–ª–µ —Å—Ç—Ä–æ–∫–∏ –∏ –º–µ—Ç–æ–¥ title () –¥–ª—è –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏—è –∑–∞–≥–ª–∞–≤–Ω–æ–π –±—É–∫–≤—ã –≤ –ø–µ—Ä–≤–æ–π –±—É–∫–≤–µ –∫–∞–∂–¥–æ–≥–æ —Å–ª–æ–≤–∞ –≤ —Å—Ç—Ä–æ–∫–µ.

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

–î–ª–∏–Ω–∞ —Å—Ç—Ä–æ–∫–∏

–ö–æ–≥–¥–∞ –≤—ã —Ä–∞–±–æ—Ç–∞–µ—Ç–µ —Å–æ —Å—Ç—Ä–æ–∫–æ–π, –≤—ã –º–æ–∂–µ—Ç–µ –∑–∞—Ö–æ—Ç–µ—Ç—å —á—Ç–æ–±—ã —É–∑–Ω–∞—Ç—å –¥–ª–∏–Ω—É —ç—Ç–æ–π —Å—Ç—Ä–æ–∫–∏. –°—Ç—Ä–æ–∫–æ–≤—ã–π –º–µ—Ç–æ–¥ Python len () –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –¥–ª—è –≤–æ–∑–≤—Ä–∞—Ç–∞ –∫–æ–ª–∏—á–µ—Å—Ç–≤–∞ —Å–∏–º–≤–æ–ª–æ–≤ –≤ —Å—Ç—Ä–æ–∫–µ.

–≠—Ç–∞ —Ñ—É–Ω–∫—Ü–∏—è –ø–æ–ª–µ–∑–Ω–∞, –µ—Å–ª–∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ –¥–ª—è —É—Å—Ç–∞–Ω–æ–≤–∫–∏ –º–∏–Ω–∏–º–∞–ª—å–Ω–æ–π –∏–ª–∏ –º–∞–∫—Å–∏–º–∞–ª—å–Ω–æ–π –¥–ª–∏–Ω—ã –ø–æ–ª—è —Ñ–æ—Ä–º—ã, –Ω–∞–ø—Ä–∏–º–µ—Ä. –ï—Å–ª–∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ, —á—Ç–æ–±—ã –∞–¥—Ä–µ—Å —ç–ª–µ–∫—Ç—Ä–æ–Ω–Ω–æ–π –ø–æ—á—Ç—ã –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—è —Å–æ—Å—Ç–æ—è–ª –Ω–µ –±–æ–ª–µ–µ —á–µ–º –∏–∑ 50 —Å–∏–º–≤–æ–ª–æ–≤, –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å len (), —á—Ç–æ–±—ã —É–∑–Ω–∞—Ç—å –¥–ª–∏–Ω—É —ç–ª–µ–∫—Ç—Ä–æ–Ω–Ω–æ–µ –ø–∏—Å—å–º–æ –∏ —Å–æ–æ–±—â–∞—Ç—å –æ–± –æ—à–∏–±–∫–µ, –µ—Å–ª–∏ –æ–Ω–æ –ø—Ä–µ–≤—ã—à–∞–µ—Ç 50 —Å–∏–º–≤–æ–ª–æ–≤. g.

–í–æ—Ç –ø—Ä–∏–º–µ—Ä –ø—Ä–æ–≥—Ä–∞–º–º—ã, –∫–æ—Ç–æ—Ä–∞—è –ø—Ä–æ–≤–µ—Ä—è–µ—Ç –¥–ª–∏–Ω—É —Å—Ç—Ä–æ–∫–∏:

–ù–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç: 34. –í –Ω–∞—à–µ–º –∫–æ–¥–µ –º—ã –æ–±—ä—è–≤–∏–ª–∏ –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é –¥–ª–∏–Ω–∞_—Å—Ç—Ä–æ–∫–∏, –≤ –∫–æ—Ç–æ—Ä–æ–π —Ö—Ä–∞–Ω–∏—Ç—Å—è —Å—Ç—Ä–æ–∫–∞ –ö–∞–∫–æ–≤–∞ –¥–ª–∏–Ω–∞ —ç—Ç–æ–π —Å—Ç—Ä–æ–∫–∏? –ó–∞—Ç–µ–º, –Ω–∞ —Å–ª–µ–¥—É—é—â–µ–π —Å—Ç—Ä–æ–∫–µ, –º—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–ª–∏ –º–µ—Ç–æ–¥ len (string_length), —á—Ç–æ–±—ã —É–∑–Ω–∞—Ç—å –¥–ª–∏–Ω–∞ –Ω–∞—à–µ–π —Å—Ç—Ä–æ–∫–∏ –∏ –ø–µ—Ä–µ–¥–∞–ª–∞ –µ–µ —á–µ—Ä–µ–∑ –º–µ—Ç–æ–¥ print (), —á—Ç–æ–±—ã –º—ã –º–æ–≥–ª–∏ –≤–∏–¥–µ—Ç—å –¥–ª–∏–Ω—É –≤ –Ω–∞—à–µ–π –∫–æ–Ω—Å–æ–ª–∏.

–ü–æ–º–Ω–∏—Ç–µ, —á—Ç–æ —Ñ—É–Ω–∫—Ü–∏—è –¥–ª–∏–Ω—ã –±—É–¥–µ—Ç —Å—á–∏—Ç–∞—Ç—å –∫–∞–∂–¥—ã–π —Å–∏–º–≤–æ–ª –≤ —Å—Ç—Ä–æ–∫–µ, –∫–æ—Ç–æ—Ä—ã–π –≤–∫–ª—é—á–∞–µ—Ç –±—É–∫–≤—ã, —á–∏—Å–ª–∞ , –∏ –ø—Ä–æ–±–µ–ª—å–Ω—ã–µ —Å–∏–º–≤–æ–ª—ã.

–õ–æ–≥–∏—á–µ—Å–∫–∏–µ —Å—Ç—Ä–æ–∫–æ–≤—ã–µ –º–µ—Ç–æ–¥—ã

–°—É—â–µ—Å—Ç–≤—É–µ—Ç —Ä—è–¥ —Å—Ç—Ä–æ–∫–æ–≤—ã—Ö –º–µ—Ç–æ–¥–æ–≤ Python, –∫–æ—Ç–æ—Ä—ã–µ –≤–æ–∑–≤—Ä–∞—â–∞—é—Ç –ª–æ–≥–∏—á–µ—Å–∫–æ–µ –∑–Ω–∞—á–µ–Ω–∏–µ. –≠—Ç–∏ –º–µ—Ç–æ–¥—ã –ø–æ–ª–µ–∑–Ω—ã, –µ—Å–ª–∏ –º—ã —Ö–æ—Ç–∏–º —É–∑–Ω–∞—Ç—å –±–æ–ª—å—à–µ –æ —Ö–∞—Ä–∞–∫—Ç–µ—Ä–∏—Å—Ç–∏–∫–∞—Ö —Å—Ç—Ä–æ–∫–∏. –ù–∞–ø—Ä–∏–º–µ—Ä, –µ—Å–ª–∏ –º—ã —Ö–æ—Ç–∏–º –ø—Ä–æ–≤–µ—Ä–∏—Ç—å, –Ω–∞–ø–∏—Å–∞–Ω–∞ –ª–∏ —Å—Ç—Ä–æ–∫–∞ –≤ –≤–µ—Ä—Ö–Ω–µ–º —Ä–µ–≥–∏—Å—Ç—Ä–µ –∏–ª–∏ –µ—Å–ª–∏ –æ–Ω–∞ —Å–æ–¥–µ—Ä–∂–∏—Ç —Ç–æ–ª—å–∫–æ —á–∏—Å–ª–∞, –º—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –º–µ—Ç–æ–¥ –ª–æ–≥–∏—á–µ—Å–∫–æ–π —Å—Ç—Ä–æ–∫–∏, –∫–æ—Ç–æ—Ä—ã–π –≤–µ—Ä–Ω–µ—Ç –∏—Å—Ç–∏–Ω—É, –µ—Å–ª–∏ –≤—Å–µ —Å–∏–º–≤–æ–ª—ã –≤ –≤–µ—Ä—Ö–Ω–µ–º —Ä–µ–≥–∏—Å—Ç—Ä–µ. & Nbsp;

–í–æ—Ç —Å–ø–∏—Å–æ–∫ —Å—Ç—Ä–æ–∫–æ–≤—ã—Ö –º–µ—Ç–æ–¥–æ–≤ Python, –∫–æ—Ç–æ—Ä—ã–µ –≤–æ–∑–≤—Ä–∞—â–∞—é—Ç True, –µ—Å–ª–∏ –∏—Ö —É—Å–ª–æ–≤–∏–µ –≤—ã–ø–æ–ª–Ω–µ–Ω–æ:

  • str.isupper (): –±—É–∫–≤–µ–Ω–Ω—ã–µ —Å–∏–º–≤–æ–ª—ã —Å—Ç—Ä–æ–∫–∏ –≤—Å–µ –≤ –≤–µ—Ä—Ö–Ω–µ–º —Ä–µ–≥–∏—Å—Ç—Ä–µ
  • str.islower (): –±—É–∫–≤–µ–Ω–Ω—ã–µ —Å–∏–º–≤–æ–ª—ã —Å—Ç—Ä–æ–∫–∏ - –≤—Å–µ —Å—Ç—Ä–æ—á–Ω—ã–µ.
  • str.istitle (): —Å—Ç—Ä–æ–∫–∞ –Ω–∞—Ö–æ–¥–∏—Ç—Å—è –≤ —Ä–µ–≥–∏—Å—Ç—Ä–µ –∑–∞–≥–æ–ª–æ–≤–∫–∞
  • str.isspace (): —Å—Ç—Ä–æ–∫–∞ —Å–æ—Å—Ç–æ–∏—Ç —Ç–æ–ª—å–∫–æ –∏–∑ —Å–∏–º–≤–æ–ª–æ–≤ –ø—Ä–æ–±–µ–ª–∞.
  • str.isnumeric (): —Å—Ç—Ä–æ–∫–∞ —Å–æ–¥–µ—Ä–∂–∏—Ç —Ç–æ–ª—å–∫–æ —á–∏—Å–ª–æ–≤—ã–µ —Å–∏–º–≤–æ–ª—ã
  • str.isalnum (): —Å—Ç—Ä–æ–∫–∞ —Å–æ–¥–µ—Ä–∂–∏—Ç —Ç–æ–ª—å–∫–æ –±—É–∫–≤–µ–Ω–Ω–æ-—Ü–∏—Ñ—Ä–æ–≤—ã–µ —Å–∏–º–≤–æ–ª—ã (–±–µ–∑ —Å–∏–º–≤–æ–ª–æ–≤)
  • str.isalpha (): –°—Ç—Ä–æ–∫–∞ —Å–æ–¥–µ—Ä–∂–∏—Ç —Ç–æ–ª—å–∫–æ –±—É–∫–≤–µ–Ω–Ω—ã–µ —Å–∏–º–≤–æ–ª—ã (–±–µ–∑ —Ü–∏—Ñ—Ä –∏–ª–∏ —Å–∏–º–≤–æ–ª–æ–≤)

–î–∞–≤–∞–π—Ç–µ —Ä–∞—Å—Å–º–æ—Ç—Ä–∏–º –Ω–µ–∫–æ—Ç–æ—Ä—ã–µ –∏–∑ —ç—Ç–∏—Ö –º–µ—Ç–æ–¥–æ–≤ –ª–æ–≥–∏—á–µ—Å–∫–∏—Ö —Å—Ç—Ä–æ–∫. –í–æ—Ç –ø—Ä–∏–º–µ—Ä –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏—è —Ñ—É–Ω–∫—Ü–∏–∏ isupper (), —á—Ç–æ–±—ã –ø—Ä–æ–≤–µ—Ä–∏—Ç—å, —Å—Ç—Ä–æ–∫–∞ —Å–æ–¥–µ—Ä–∂–∏—Ç —Ç–æ–ª—å–∫–æ —Å–∏–º–≤–æ–ª—ã –≤–µ—Ä—Ö–Ω–µ–≥–æ —Ä–µ–≥–∏—Å—Ç—Ä–∞:

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

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

< p> –ù–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç: True. –ü–µ—Ä–µ–º–µ–Ω–Ω–∞—è full_name —Å–æ–¥–µ—Ä–∂–∏—Ç –∑–Ω–∞—á–µ–Ω–∏–µ —Å —Ç–µ–∫—Å—Ç–æ–º, –ø–æ–ª–Ω–æ—Å—Ç—å—é –Ω–∞–ø–∏—Å–∞–Ω–Ω—ã–º –≤ –≤–µ—Ä—Ö–Ω–µ–º —Ä–µ–≥–∏—Å—Ç—Ä–µ, –ø–æ—ç—Ç–æ–º—É –Ω–∞—à–∞ —Ñ—É–Ω–∫—Ü–∏—è isupper () –æ—Ü–µ–Ω–∏–≤–∞–µ—Ç –∑–Ω–∞—á–µ–Ω–∏–µ True –∏ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç –∑–Ω–∞—á–µ–Ω–∏–µ True. –∑–Ω–∞—á–µ–Ω–∏–µ.

–¢–æ—á–Ω–æ —Ç–∞–∫ –∂–µ –º—ã –º–æ–∂–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ñ—É–Ω–∫—Ü–∏—é istitle (), —á—Ç–æ–±—ã –ø—Ä–æ–≤–µ—Ä–∏—Ç—å, –Ω–∞—Ö–æ–¥–∏—Ç—Å—è –ª–∏ —Å—Ç—Ä–æ–∫–∞ –≤ —Ä–µ–≥–∏—Å—Ç—Ä–µ –∑–∞–≥–æ–ª–æ–≤–∫–∞:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç: False. –ü–æ—Å–∫–æ–ª—å–∫—É –Ω–∞—à –∫–æ–¥ —Å—Ç—Ä–æ–∫–∞ –Ω–µ –≤ —Ä–µ–≥–∏—Å—Ç—Ä–µ –∑–∞–≥–æ–ª–æ–≤–∫–∞ & mdash; –∫–∞–∂–¥—ã–π —Å–∏–º–≤–æ–ª –Ω–µ –Ω–∞—á–∏–Ω–∞–µ—Ç—Å—è —Å –∑–∞–≥–ª–∞–≤–Ω–æ–π –±—É–∫–≤—ã & mdash; –Ω–∞—à –º–µ—Ç–æ–¥ istitle () –æ—Ü–µ–Ω–∏–≤–∞–µ—Ç—Å—è –∫–∞–∫ False.

–ú–µ—Ç–æ–¥—ã –ª–æ–≥–∏—á–µ—Å–∫–∏—Ö —Å—Ç—Ä–æ–∫ –º–æ–≥—É—Ç –±—ã—Ç—å –ø–æ–ª–µ–∑–Ω—ã –ø—Ä–∏ –ø–æ–ª—É—á–µ–Ω–∏–∏ –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—å—Å–∫–æ–≥–æ –≤–≤–æ–¥–∞ –∫–æ—Ç–æ—Ä—ã–µ –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø—Ä–æ–≤–µ—Ä–∏—Ç—å, –∏–ª–∏ –µ—Å–ª–∏ —É –≤–∞—Å –µ—Å—Ç—å –¥–≤–∞ —Ç–æ—á–Ω—ã—Ö –∑–Ω–∞—á–µ–Ω–∏—è, –∫–æ—Ç–æ—Ä—ã–µ –≤—ã —Ö–æ—Ç–∏—Ç–µ —Å—Ä–∞–≤–Ω–∏—Ç—å.

–ù–∞—á–∏–Ω–∞–µ—Ç—Å—è —Å d –ó–∞–∫–∞–Ω—á–∏–≤–∞–µ—Ç—Å—è –Ω–∞

–î–æ–ø—É—Å—Ç–∏–º, —É –≤–∞—Å –µ—Å—Ç—å —Å—Ç—Ä–æ–∫–∞, –∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø—Ä–æ–≤–µ—Ä–∏—Ç—å, –Ω–∞—á–∏–Ω–∞–µ—Ç—Å—è –æ–Ω–∞ –∏–ª–∏ –∑–∞–∫–∞–Ω—á–∏–≤–∞–µ—Ç—Å—è –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω—ã–º –∑–Ω–∞—á–µ–Ω–∏–µ–º. –ù–∞–ø—Ä–∏–º–µ—Ä, —É –≤–∞—Å –º–æ–∂–µ—Ç –±—ã—Ç—å –∏–º—è –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—è, –∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø—Ä–æ–≤–µ—Ä–∏—Ç—å, –Ω–∞—á–∏–Ω–∞–µ—Ç—Å—è –ª–∏ –æ–Ω–æ —Å F. –ú—ã –º–æ–∂–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ñ—É–Ω–∫—Ü–∏–∏ startwith () –∏ endwith () –¥–ª—è –ø—Ä–æ–≤–µ—Ä–∫–∏ –Ω–∞—à–∏—Ö —Å—Ç—Ä–æ–∫.

–ú–µ—Ç–æ–¥ startwith () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç True, –µ—Å–ª–∏ —Å—Ç—Ä–æ–∫–∞ –Ω–∞—á–∏–Ω–∞–µ—Ç—Å—è —Å –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω–æ–≥–æ –∑–Ω–∞—á–µ–Ω–∏—è, –∞ –º–µ—Ç–æ–¥ endwith () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç True, –µ—Å–ª–∏ —Å—Ç—Ä–æ–∫–∞ –∑–∞–∫–∞–Ω—á–∏–≤–∞–µ—Ç—Å—è –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω—ã–º –∑–Ω–∞—á–µ–Ω–∏–µ–º. –í –ø—Ä–æ—Ç–∏–≤–Ω–æ–º —Å–ª—É—á–∞–µ —Å—Ç—Ä–æ–∫–æ–≤—ã–µ –º–µ—Ç–æ–¥—ã –≤–æ–∑–≤—Ä–∞—â–∞—é—Ç false.

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

–í–æ—Ç –ø—Ä–∏–º–µ—Ä —Ñ—É–Ω–∫—Ü–∏–∏ playswith () –≤ –¥–µ–π—Å—Ç–≤–∏–∏:

–ù–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç: True.

–ï—Å–ª–∏ –±—ã –º—ã —Ö–æ—Ç–µ–ª–∏ –ø—Ä–æ–≤–µ—Ä–∏—Ç—å, –ø–æ—è–≤–∏–ª—Å—è –ª–∏ Bill –≤ –Ω–∞—à–µ–π —Å—Ç—Ä–æ–∫–µ, –Ω–∞—á–∏–Ω–∞—é—â–µ–π—Å—è –ø–æ—Å–ª–µ —á–µ—Ç–≤–µ—Ä—Ç–æ–π –±—É–∫–≤—ã –≤ –Ω–∞—à–µ–π —Å—Ç—Ä–æ–∫–µ & mdash; —ç–ª–µ–º–µ–Ω—Ç —Å–æ –∑–Ω–∞—á–µ–Ω–∏–µ–º –∏–Ω–¥–µ–∫—Å–∞ 3, –ø–æ—Å–∫–æ–ª—å–∫—É –∏–Ω–¥–µ–∫—Å—ã –Ω–∞—á–∏–Ω–∞—é—Ç—Å—è —Å & mdash; –º—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Å–ª–µ–¥—É—é—â–∏–π –∫–æ–¥:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç False, –ø–æ—Ç–æ–º—É —á—Ç–æ Bill –Ω–µ –ø–æ—è–≤–ª—è–µ—Ç—Å—è –≤ —Å—Ç—Ä–æ–∫–µ –ø–æ—Å–ª–µ –∑–Ω–∞—á–µ–Ω–∏—è –∏–Ω–¥–µ–∫—Å–∞ 3 .

–†–∞–∑–¥–µ–ª–µ–Ω–∏–µ –∏ –æ–±—ä–µ–¥–∏–Ω–µ–Ω–∏–µ —Å—Ç—Ä–æ–∫

–ö—Ä–æ–º–µ —Ç–æ–≥–æ, –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –º–µ—Ç–æ–¥—ã join () –∏ split () –¥–ª—è —É–ø—Ä–∞–≤–ª–µ–Ω–∏—è —Å—Ç—Ä–æ–∫–∞–º–∏ –≤ Python.

–ú–µ—Ç–æ–¥ join () –±–µ—Ä–µ—Ç –≤—Å–µ —ç–ª–µ–º–µ–Ω—Ç—ã –≤ –ø–æ–≤—Ç–æ—Ä—è–µ–º–æ–π —Å—Ç—Ä–æ–∫–µ –∏ –ø—Ä–∏—Å–æ–µ–¥–∏–Ω—è–µ—Ç –∏—Ö –∫ –¥—Ä—É–≥–æ–π —Å—Ç—Ä–æ–∫–µ. –í–æ—Ç –ø—Ä–∏–º–µ—Ä —Å—Ç—Ä–æ–∫–æ–≤–æ–≥–æ –º–µ—Ç–æ–¥–∞ Python join () –≤ –¥–µ–π—Å—Ç–≤–∏–∏:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Å–ª–µ–¥—É—é—â–µ–µ: SXtXrXiXnXg. –ü—Ä–æ–∏–∑–æ—à–ª–æ —Ç–æ, —á—Ç–æ —Å—Ç—Ä–æ–∫–∞ join () –ø—Ä–æ—à–ª–∞ —á–µ—Ä–µ–∑ –∫–∞–∂–¥—É—é –±—É–∫–≤—É –≤ –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π string –∏ –¥–æ–±–∞–≤–∏–ª–∞ X –ø–æ—Å–ª–µ –∫–∞–∂–¥–æ–π –±—É–∫–≤—ã.

–ú–µ—Ç–æ–¥ join () –º–æ–∂–µ—Ç –±—ã—Ç—å –ø–æ–ª–µ–∑–µ–Ω, –µ—Å–ª–∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ –æ–±—ä–µ–¥–∏–Ω–∏—Ç—å –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω–æ–µ –∑–Ω–∞—á–µ–Ω–∏–µ –≤–º–µ—Å—Ç–µ —Å–æ —Å—Ç—Ä–æ–∫–æ–π. –≠—Ç–æ—Ç –º–µ—Ç–æ–¥ —Ç–∞–∫–∂–µ —á–∞—Å—Ç–æ –∏—Å–ø–æ–ª—å–∑—É–µ—Ç—Å—è –¥–ª—è –æ–±—ä–µ–¥–∏–Ω–µ–Ω–∏—è —Å–ø–∏—Å–æ–∫ —Å—Ç—Ä–æ–∫ –≤–º–µ—Å—Ç–µ. –í–æ—Ç –ø—Ä–∏–º–µ—Ä –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏—è join () –¥–ª—è –æ–±—ä–µ–¥–∏–Ω–µ–Ω–∏—è —Å–ø–∏—Å–∫–∞ —Å—Ç—Ä–æ–∫ –≤ –æ–¥–Ω—É:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Å–ª–µ–¥—É—é—â–µ–µ: –õ—é—Å–∏, –≠–º–∏–ª–∏, –î—ç–≤–∏–¥. –¢–µ–ø–µ—Ä—å –Ω–∞—à —Å–ø–∏—Å–æ–∫ –∏–º–µ–Ω —Å–æ—Å—Ç–æ–∏—Ç –∏–∑ –æ–¥–Ω–æ–π —Å—Ç—Ä–æ–∫–∏, –∞ –Ω–µ –º–∞—Å—Å–∏–≤–∞.

–ú—ã —Ç–∞–∫–∂–µ –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Å—Ç—Ä–æ–∫–æ–≤—ã–π –º–µ—Ç–æ–¥ split () –¥–ª—è —Ä–∞–∑–¥–µ–ª–µ–Ω–∏—è —Å—Ç—Ä–æ–∫–∏ –∏ –≤–æ–∑–≤—Ä–∞—Ç–∞ —Å–ø–∏—Å–∫–∞ —Å—Ç—Ä–æ–∫. –í–æ—Ç –ø—Ä–∏–º–µ—Ä –º–µ—Ç–æ–¥–∞ split (), –∏—Å–ø–æ–ª—å–∑—É–µ–º–æ–≥–æ –¥–ª—è —Ä–∞–∑–¥–µ–ª–µ–Ω–∏—è –ø—Ä–µ–¥–ª–æ–∂–µ–Ω–∏–µ –≤ —Å–ø–∏—Å–æ–∫ —Å—Ç—Ä–æ–∫:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Å–ª–µ–¥—É—é—â–µ–µ:

–ö–∞–∫ –≤–∏–¥–∏—Ç–µ, –Ω–∞—à–∞ –∏—Å—Ö–æ–¥–Ω–∞—è —Å—Ç—Ä–æ–∫–∞ –±—ã–ª–∞ —Ä–∞–∑–¥–µ–ª–µ–Ω–∞ –Ω–∞ —á–µ—Ç—ã—Ä–µ —ç–ª–µ–º–µ–Ω—Ç–∞, –∏ –±—ã–ª —Å–æ–∑–¥–∞–Ω –Ω–æ–≤—ã–π —Å–ø–∏—Å–æ–∫ —ç—Ç–∏—Ö —ç–ª–µ–º–µ–Ω—Ç–æ–≤.

–ú–µ—Ç–æ–¥ split () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Å–ø–∏—Å–æ–∫ —Ä–∞–∑–¥–µ–ª–µ–Ω–Ω—ã—Ö —Å—Ç—Ä–æ–∫ –ø—Ä–æ–±–µ–ª—å–Ω—ã–º–∏ —Å–∏–º–≤–æ–ª–∞–º–∏, –µ—Å–ª–∏ –Ω–µ —É–∫–∞–∑–∞–Ω –¥—Ä—É–≥–æ–π –ø–∞—Ä–∞–º–µ—Ç—Ä, –Ω–æ –µ—Å–ª–∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ —Ä–∞–∑–¥–µ–ª–∏—Ç—å —Å—Ç—Ä–æ–∫—É –¥—Ä—É–≥–∏–º —Å–∏–º–≤–æ–ª–æ–º, –≤—ã –º–æ–∂–µ—Ç–µ. –í–æ—Ç –ø—Ä–∏–º–µ—Ä –ø—Ä–æ–≥—Ä–∞–º–º—ã, –∫–æ—Ç–æ—Ä–∞—è —Ä–∞–∑–¥–µ–ª—è–µ—Ç —Å—Ç—Ä–æ–∫—É –Ω–∞ –æ—Å–Ω–æ–≤–µ –∑–∞–ø—è—Ç—ã—Ö –≤ —ç—Ç–æ–π —Å—Ç—Ä–æ–∫–µ:

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

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

–ü—Ä–æ—Å–º–æ—Ç—Ä–∏—Ç–µ Repl.it –∏–∑ —ç—Ç–æ–≥–æ —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–∞:



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

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

–ú—ã –æ–±—Å—É–¥–∏–ª–∏ upper () –∏ lower () –∏ –∫–∞–∫ –æ–Ω–∏ –º–æ–≥—É—Ç –ø–æ–º–æ—á—å –≤–∞–º –≤ —Ä–∞–±–æ—Ç–µ —Å –∫–µ–π—Å–∞–º–∏ –≤ Python, –º–µ—Ç–æ–¥ len () –∏ –∫–∞–∫ –æ–Ω –º–æ–∂–µ—Ç –ø–æ–º–æ—á—å –≤–∞–º –ø–æ–ª—É—á–∏—Ç—å –¥–ª–∏–Ω—É —Å—Ç—Ä–æ–∫–∏, –∞ —Ç–∞–∫–∂–µ –º—ã –∏—Å—Å–ª–µ–¥–æ–≤–∞–ª–∏ –ª–æ–≥–∏—á–µ—Å–∫—É—é —Å—Ç—Ä–æ–∫—É –º–µ—Ç–æ–¥—ã, –¥–æ—Å—Ç—É–ø–Ω—ã–µ –≤ Python.

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

–°—Ç–æ–∏—Ç –æ—Ç–º–µ—Ç–∏—Ç—å, —á—Ç–æ —Å—É—â–µ—Å—Ç–≤—É–µ—Ç —Ä—è–¥ –¥—Ä—É–≥–∏—Ö —Å—Ç—Ä–æ–∫–æ–≤—ã—Ö –º–µ—Ç–æ–¥–æ–≤, —Ç–∞–∫–∏—Ö –∫–∞–∫ ljust (), rjust () –∏ zfill (), –∏ —ç—Ç–∞ —Å—Ç–∞—Ç—å—è –ª–∏—à—å –ø–æ–≤–µ—Ä—Ö–Ω–æ—Å—Ç–Ω–æ. –¢–µ–ø–µ—Ä—å –≤—ã –≥–æ—Ç–æ–≤—ã –Ω–∞—á–∞—Ç—å —Ä–∞–±–æ—Ç–∞—Ç—å —Å–æ —Å—Ç—Ä–æ–∫–∞–º–∏ –≤ Python –∫–∞–∫ —ç–∫—Å–ø–µ—Ä—Ç!

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method