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

–§—É–Ω–∫—Ü–∏—è Python zip () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –ø–æ–≤—Ç–æ—Ä—è–µ–º—ã–µ —ç–ª–µ–º–µ–Ω—Ç—ã –∏ –æ–±—ä–µ–¥–∏–Ω—è–µ—Ç –∏—Ö –≤ –æ–¥–∏–Ω –∫–æ—Ä—Ç–µ–∂. –†–µ–∑—É–ª—å—Ç–∏—Ä—É—é—â–µ–µ –∑–Ω–∞—á–µ–Ω–∏–µ –ø—Ä–µ–¥—Å—Ç–∞–≤–ª—è–µ—Ç —Å–æ–±–æ–π zip-–æ–±—ä–µ–∫—Ç, –≤ –∫–æ—Ç–æ—Ä–æ–º —Ö—Ä–∞–Ω—è—Ç—Å—è –ø–∞—Ä—ã –∏—Ç–µ—Ä–∞—Ü–∏–π. –í—ã –º–æ–∂–µ—Ç–µ –ø–µ—Ä–µ–¥–∞–≤–∞—Ç—å —Å–ø–∏—Å–∫–∏, –∫–æ—Ä—Ç–µ–∂–∏, –Ω–∞–±–æ—Ä—ã –∏–ª–∏ —Å–ª–æ–≤–∞—Ä–∏ —Å –ø–æ–º–æ—â—å—é —Ñ—É–Ω–∫—Ü–∏–∏ zip ().

Python –∏–º–µ–µ—Ç —Ä—è–¥ –≤—Å—Ç—Ä–æ–µ–Ω–Ω—ã—Ö —Ñ—É–Ω–∫—Ü–∏–π, –∫–æ—Ç–æ—Ä—ã–µ –ø–æ–∑–≤–æ–ª—è—é—Ç –∫–æ–¥–∏—Ä–æ–≤—â–∏–∫–∞–º –ø–µ—Ä–µ–±–∏—Ä–∞—Ç—å –¥–∞–Ω–Ω—ã–µ –≤ —Ü–∏–∫–ª–µ. –û–¥–Ω–∞ –∏–∑ —ç—Ç–∏—Ö —Ñ—É–Ω–∫—Ü–∏–π - Python zip. –§—É–Ω–∫—Ü–∏—è zip () —Å–æ–∑–¥–∞–µ—Ç –∏—Ç–µ—Ä–∞—Ç–æ—Ä, –∫–æ—Ç–æ—Ä—ã–π –æ–±—ä–µ–¥–∏–Ω—è–µ—Ç —ç–ª–µ–º–µ–Ω—Ç—ã –∏–∑ –¥–≤—É—Ö –∏–ª–∏ –±–æ–ª–µ–µ –∏—Å—Ç–æ—á–Ω–∏–∫–æ–≤ –¥–∞–Ω–Ω—ã—Ö –≤ –æ–¥–∏–Ω.

–í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –º—ã —Ä–∞–∑–±–µ—Ä–µ–º –æ—Å–Ω–æ–≤—ã Python zip (). –ú—ã —Ç–∞–∫–∂–µ –æ–±—Å—É–¥–∏–º, –∫–∞–∫ –ø–µ—Ä–µ–±–∏—Ä–∞—Ç—å zip-–∞—Ä—Ö–∏–≤ –∏ –∫–∞–∫ —Ä–∞—Å–ø–∞–∫–æ–≤—ã–≤–∞—Ç—å –∑–∞–∞—Ä—Ö–∏–≤–∏—Ä–æ–≤–∞–Ω–Ω—ã–π –æ–±—ä–µ–∫—Ç.

Python Iteration Refresher

–í Python –º—ã –∏—Å–ø–æ–ª—å–∑—É–π—Ç–µ —Ç–µ—Ä–º–∏–Ω i terate , —á—Ç–æ–±—ã –æ–ø–∏—Å–∞—Ç—å, –∫–æ–≥–¥–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –≤—ã–ø–æ–ª–Ω—è–µ—Ç—Å—è —á–µ—Ä–µ–∑ —Å–ø–∏—Å–æ–∫. –ù–∞–ø—Ä–∏–º–µ—Ä, –ø—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, —á—Ç–æ —É –≤–∞—Å –µ—Å—Ç—å —Ü–∏–∫–ª for , –∫–æ—Ç–æ—Ä—ã–π —Ä–∞—Å–ø–µ—á–∞—Ç—ã–≤–∞–µ—Ç –Ω–∞–∑–≤–∞–Ω–∏–µ –∫–∞–∂–¥–æ–≥–æ —Ñ–∏–ª–∏–∞–ª–∞ –∫–æ–º–ø–∞–Ω–∏–∏. –ú—ã –±—ã —Å–∫–∞–∑–∞–ª–∏, —á—Ç–æ –Ω–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –≤—ã–ø–æ–ª–Ω—è–µ—Ç –∏—Ç–µ—Ä–∞—Ü–∏—é –ø–æ —Å–ø–∏—Å–∫—É –∏–º–µ–Ω.

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

Python zip Function

–§—É–Ω–∫—Ü–∏—è zip () –æ–±—ä–µ–¥–∏–Ω—è–µ—Ç —Å–æ–¥–µ—Ä–∂–∏–º–æ–µ –¥–≤–∞ –∏–ª–∏ –±–æ–ª–µ–µ –∏—Ç–µ—Ä–∞—Ü–∏–π. zip () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç zip-–æ–±—ä–µ–∫—Ç. –≠—Ç–æ –∏—Ç–µ—Ä–∞—Ç–æ—Ä –∫–æ—Ä—Ç–µ–∂–µ–π, –≤ –∫–æ—Ç–æ—Ä–æ–º –≤—Å–µ –∑–Ω–∞—á–µ–Ω–∏—è, –∫–æ—Ç–æ—Ä—ã–µ –≤—ã –ø–µ—Ä–µ–¥–∞–ª–∏ –≤ –∫–∞—á–µ—Å—Ç–≤–µ –∞—Ä–≥—É–º–µ–Ω—Ç–æ–≤, —Ö—Ä–∞–Ω—è—Ç—Å—è –≤ –≤–∏–¥–µ –ø–∞—Ä.

–§—É–Ω–∫—Ü–∏—è Python " s zip () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –∏—Ç–µ—Ä–∏—Ä—É–µ–º—ã–π & mdash; –Ω–∞–ø—Ä–∏–º–µ—Ä —Å–ø–∏—Å–æ–∫, tuple, set –∏–ª–∏ —Å–ª–æ–≤–∞—Ä—å & mdash; –≤ –∫–∞—á–µ—Å—Ç–≤–µ –∞—Ä–≥—É–º–µ–Ω—Ç–∞. –§—É–Ω–∫—Ü–∏—è —Å–≥–µ–Ω–µ—Ä–∏—Ä—É–µ—Ç —Å–ø–∏—Å–æ–∫ –∫–æ—Ä—Ç–µ–∂–µ–π, —Å–æ–¥–µ—Ä–∂–∞—â–∏—Ö —ç–ª–µ–º–µ–Ω—Ç—ã –∏–∑ –∫–∞–∂–¥–æ–π –∏—Ç–µ—Ä–∞—Ü–∏–∏, –∫–æ—Ç–æ—Ä—É—é –≤—ã –ø–µ—Ä–µ–¥–∞–ª–∏ –≤ —Ñ—É–Ω–∫—Ü–∏—é.

–°–∏–Ω—Ç–∞–∫—Å–∏—Å —Ñ—É–Ω–∫—Ü–∏–∏ zip () —Å–ª–µ–¥—É—é—â–∏–π:

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

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

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

style-decoration: text-decoration: hover .postTitle> –æ—Ç—Å—Ç—É–ø —Å–ª–µ–≤–∞: 1em; padding-right: 1em; "> " –ë–û–õ–¨–®–ï: & nbsp; Python: —É–¥–∞–ª–∏—Ç—å –ø–æ—Å–ª–µ–¥–Ω–∏–π —Å–∏–º–≤–æ–ª –∏–∑ —Å—Ç—Ä–æ–∫–∏

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

–ü—Ä–∏–º–µ—Ä zip Python

–î–æ–ø—É—Å—Ç–∏–º, —É –≤–∞—Å –µ—Å—Ç—å –¥–≤–∞ —Å–ø–∏—Å–∫–∞ Python . –û–¥–∏–Ω —Å–ø–∏—Å–æ–∫ —Å–æ–¥–µ—Ä–∂–∏—Ç –∏–º–µ–Ω–∞ —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–æ–≤ –∏ –¥—Ä—É–≥–æ–π —Å–ø–∏—Å–æ–∫ —Å–æ–¥–µ—Ä–∂–∏—Ç –Ω–æ–º–µ—Ä–∞ —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–æ–≤. –í—ã —Ö–æ—Ç–∏—Ç–µ –æ–±—ä–µ–¥–∏–Ω–∏—Ç—å –æ–±–∞ —Å–ø–∏—Å–∫–∞ –≤ –º–∞—Å—Å–∏–≤ –∫–æ—Ä—Ç–µ–∂–µ–π. –≠—Ç–æ –ø–æ–∑–≤–æ–ª–∏—Ç –≤–∞–º —Ö—Ä–∞–Ω–∏—Ç—å –∏–º–µ–Ω–∞ –∏ –Ω–æ–º–µ—Ä–∞ —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–æ–≤ –±–æ–∫ –æ –±–æ–∫.

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

–ù–∞—à–∞ —Ñ—É–Ω–∫—Ü–∏—è zip –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Å–ª–µ–¥—É—é—â–µ–µ:

< p> –ù–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ —Å–æ–∑–¥–∞–ª–∞ –º–∞—Å—Å–∏–≤ —ç–ª–µ–º–µ–Ω—Ç–æ–≤ –∫–æ—Ä—Ç–µ–∂–∞ . –ö–∞–∂–¥—ã–π –∫–æ—Ä—Ç–µ–∂ —Å–æ–¥–µ—Ä–∂–∏—Ç –∏–º—è —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–∞ –∏ —Å–æ–æ—Ç–≤–µ—Ç—Å—Ç–≤—É—é—â–∏–π –Ω–æ–º–µ—Ä —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–∞.

–í –ø–µ—Ä–≤—ã—Ö –¥–≤—É—Ö —Å—Ç—Ä–æ–∫–∞—Ö –Ω–∞—à–µ–≥–æ –∫–æ–¥–∞ –º—ã –æ–±—ä—è–≤–ª—è–µ–º –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ, –≤ –∫–æ—Ç–æ—Ä—ã—Ö —Ö—Ä–∞–Ω—è—Ç—Å—è –Ω–æ–º–µ—Ä–∞ –∏ –∏–º–µ–Ω–∞ —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–æ–≤.

–î–∞–ª–µ–µ , –º—ã –≤—ã–ø–æ–ª–Ω—è–µ–º —Ñ—É–Ω–∫—Ü–∏—é zip (). –≠—Ç–∞ —Ñ—É–Ω–∫—Ü–∏—è –æ–±—ä–µ–¥–∏–Ω—è–µ—Ç –Ω–∞—à–∏ –¥–≤–∞ —Å–ø–∏—Å–∫–∞ –≤–º–µ—Å—Ç–µ –∏ —Å–æ–∑–¥–∞–µ—Ç –Ω–æ–≤—ã–π –º–∞—Å—Å–∏–≤ –∫–æ—Ä—Ç–µ–∂–µ–π.

–ú—ã –∫–æ–Ω–≤–µ—Ä—Ç–∏—Ä—É–µ–º –Ω–∞—à zip-—ç–ª–µ–º–µ–Ω—Ç –≤ —Å–ø–∏—Å–æ–∫. –≠—Ç–æ –ø–æ—Ç–æ–º—É, —á—Ç–æ —Ñ—É–Ω–∫—Ü–∏—è zip () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç zip-–æ–±—ä–µ–∫—Ç. –ú—ã –º–æ–∂–µ–º –ø–µ—Ä–µ–±–∏—Ä–∞—Ç—å zip-–æ–±—ä–µ–∫—Ç. –û–¥–Ω–∞–∫–æ –º—ã –Ω–µ –º–æ–∂–µ–º —Ä–∞—Å–ø–µ—á–∞—Ç–∞—Ç—å zip –Ω–∞ –∫–æ–Ω—Å–æ–ª—å –∏ —É–≤–∏–¥–µ—Ç—å –µ–≥–æ —Å–æ–¥–µ—Ä–∂–∏–º–æ–µ –≤ —É–¥–æ–±–æ—á–∏—Ç–∞–µ–º–æ–π —Ñ–æ—Ä–º–µ. –ú—ã –¥–æ–ª–∂–Ω—ã –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å –Ω–∞—à zip-–æ–±—ä–µ–∫—Ç –≤ —Å–ø–∏—Å–æ–∫, —á—Ç–æ–±—ã –º—ã –º–æ–≥–ª–∏ –ø—Ä–æ—Å–º–∞—Ç—Ä–∏–≤–∞—Ç—å –µ–≥–æ —Å–æ–¥–µ—Ä–∂–∏–º–æ–µ –∏–∑ –∫–æ–Ω—Å–æ–ª–∏.

–ú—ã –º–æ–∂–µ–º —Å–∫–∞–∑–∞—Ç—å, —á—Ç–æ –Ω–∞—à–∏ zip_values ‚Äã‚Äã - —ç—Ç–æ zip ( ), –¥–æ–±–∞–≤–∏–≤ —Å–ª–µ–¥—É—é—â–∏–π –∫–æ–¥ –≤ –Ω–∞—à—É –ø—Ä–æ–≥—Ä–∞–º–º—É –≤—ã—à–µ:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Å–ª–µ–¥—É—é—â–∏–π –∑–∞–∞—Ä—Ö–∏–≤–∏—Ä–æ–≤–∞–Ω–Ω—ã–π –∫–ª–∞—Å—Å:

–í –ø—Ä–∏–≤–µ–¥–µ–Ω–Ω–æ–º –≤—ã—à–µ –ø—Ä–∏–º–µ—Ä–µ –º—ã –∑–∞–∞—Ä—Ö–∏–≤–∏—Ä–æ–≤–∞–ª–∏ –¥–≤–∞ —ç–ª–µ–º–µ–Ω—Ç–∞ –≤–º–µ—Å—Ç–µ. –û–¥–Ω–∞–∫–æ, –µ—Å–ª–∏ –±—ã —É –Ω–∞—Å –±—ã–ª–æ –±–æ–ª—å—à–µ, —á—Ç–æ –º—ã —Ö–æ—Ç–µ–ª–∏ –±—ã –∑–∞–∞—Ä—Ö–∏–≤–∏—Ä–æ–≤–∞—Ç—å, –º—ã –º–æ–≥–ª–∏ –±—ã —ç—Ç–æ —Å–¥–µ–ª–∞—Ç—å. –ï–¥–∏–Ω—Å—Ç–≤–µ–Ω–Ω–æ–µ –∏–∑–º–µ–Ω–µ–Ω–∏–µ, –∫–æ—Ç–æ—Ä–æ–µ –º—ã —Ö–æ—Ç–µ–ª–∏ –±—ã —Å–¥–µ–ª–∞—Ç—å, - —ç—Ç–æ –ø–µ—Ä–µ–¥–∞—Ç—å –¥—Ä—É–≥–æ–π —Å–ø–∏—Å–æ–∫ —ç–ª–µ–º–µ–Ω—Ç–æ–≤ –Ω–∞—à–µ–π —Ñ—É–Ω–∫—Ü–∏–∏ zip ().

–¶–∏–∫–ª –ø–æ –∏—Ç–µ—Ä–∞—Ü–∏—è–º —Å –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏–µ–º zip –≤ Python

–§—É–Ω–∫—Ü–∏—è zip () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç –∏—Ç–µ—Ä–∞—Ç–æ—Ä. –≠—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ –º—ã –º–æ–∂–µ–º –ø—Ä–æ—Å–º–∞—Ç—Ä–∏–≤–∞—Ç—å —Å–æ–¥–µ—Ä–∂–∏–º–æ–µ –∫–∞–∂–¥–æ–≥–æ –∑–∞–∞—Ä—Ö–∏–≤–∏—Ä–æ–≤–∞–Ω–Ω–æ–≥–æ —ç–ª–µ–º–µ–Ω—Ç–∞ –ø–æ –æ—Ç–¥–µ–ª—å–Ω–æ—Å—Ç–∏.

–†–∞–±–æ—Ç–∞ —Å –Ω–µ—Å–∫–æ–ª—å–∫–∏–º–∏ –∏—Ç–µ—Ä–∞—Ü–∏—è–º–∏ - –æ–¥–∏–Ω –∏–∑ —Å–∞–º—ã—Ö –ø–æ–ø—É–ª—è—Ä–Ω—ã—Ö –≤–∞—Ä–∏–∞–Ω—Ç–æ–≤ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏—è —Ñ—É–Ω–∫—Ü–∏–∏ zip () –≤ Python. –ù–∞–ø—Ä–∏–º–µ—Ä, –µ—Å–ª–∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø—Ä–æ—Å–º–æ—Ç—Ä–µ—Ç—å –Ω–µ—Å–∫–æ–ª—å–∫–æ —Å–ø–∏—Å–∫–æ–≤, –≤—ã –º–æ–∂–µ—Ç–µ –∑–∞—Ö–æ—Ç–µ—Ç—å —Å–¥–µ–ª–∞—Ç—å –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–Ω–∏–µ —Ñ—É–Ω–∫—Ü–∏–∏ zip ().

–î–∞–≤–∞–π—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ñ—É–Ω–∫—Ü–∏—é zip () –¥–ª—è –ø–µ—Ä–µ–±–æ—Ä–∞ –∫–∞–∫ –Ω–∞—à–∏—Ö —Å–ø–∏—Å–∫–æ–≤ employee_numbers, —Ç–∞–∫ –∏ employee_names:

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

–ù–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –≤—ã–ø–æ–ª–Ω—è–µ—Ç –∏—Ç–µ—Ä–∞—Ü–∏—é –ø–æ —Å–ø–∏—Å–∫—É –∫–æ—Ä—Ç–µ–∂–µ–π, –∫–æ—Ç–æ—Ä—ã–π –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç zip () , –∏ –¥–µ–ª–∏—Ç –∏—Ö –Ω–∞ –¥–≤–∞ –∑–Ω–∞—á–µ–Ω–∏—è: –∏–º—è –∏ —á–∏—Å–ª–æ.

–≠—Ç–æ –ø–æ–∑–≤–æ–ª—è–µ—Ç –Ω–∞–º –ª–µ–≥–∫–æ –ø–µ—Ä–µ–±–∏—Ä–∞—Ç—å –Ω–µ—Å–∫–æ–ª—å–∫–æ –ø–æ–≤—Ç–æ—Ä—è–µ–º—ã—Ö –æ–±—ä–µ–∫—Ç–æ–≤ –æ–¥–Ω–æ–≤—Ä–µ–º–µ–Ω–Ω–æ. –¢–µ–ø–µ—Ä—å –º—ã –º–æ–∂–µ–º –ø—Ä–æ—Å–º–∞—Ç—Ä–∏–≤–∞—Ç—å –∏–º—è –∫–∞–∂–¥–æ–≥–æ —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–∞ –≤–º–µ—Å—Ç–µ —Å —Å–æ–æ—Ç–≤–µ—Ç—Å—Ç–≤—É—é—â–∏–º –Ω–æ–º–µ—Ä–æ–º —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–∞. –ï—Å–ª–∏ –±—ã –º—ã –∑–∞—Ö–æ—Ç–µ–ª–∏, –º—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —ç—Ç–æ –¥–ª—è –∏—Ç–µ—Ä–∞—Ü–∏–∏ –ø–æ —Ç—Ä–µ–º –∏ –±–æ–ª–µ–µ –∏—Ç–µ—Ä–∞—Ç–∏–≤–Ω—ã–º –æ–±—ä–µ–∫—Ç–∞–º.

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

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

–í –Ω–∞—à–µ–º –∫–æ–¥–µ , –º—ã –∑–∞–∞—Ä—Ö–∏–≤–∏—Ä–æ–≤–∞–ª–∏ —Ä–∞–∑–ª–∏—á–Ω—ã–µ —Ç–∏–ø—ã –¥–∞–Ω–Ω—ã—Ö. –ù–æ –∫–∞–∫ –≤–æ—Å—Å—Ç–∞–Ω–æ–≤–∏—Ç—å –¥–∞–Ω–Ω—ã–µ –≤ –ø—Ä–µ–∂–Ω–µ–º –≤–∏–¥–µ? –ï—Å–ª–∏ —É –≤–∞—Å –µ—Å—Ç—å —Å–ø–∏—Å–æ–∫ –∫–æ—Ä—Ç–µ–∂–µ–π & mdash; –∏–ª–∏ –∑–∞–∞—Ä—Ö–∏–≤–∏—Ä–æ–≤–∞–Ω–Ω—ã—Ö –∑–Ω–∞—á–µ–Ω–∏–π & mdash;, –∫–æ—Ç–æ—Ä—ã–µ –≤—ã —Ö–æ—Ç–∏—Ç–µ —Ä–∞–∑–¥–µ–ª–∏—Ç—å, –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –æ–ø–µ—Ä–∞—Ç–æ—Ä —Ä–∞—Å–ø–∞–∫–æ–≤–∫–∏ —Ñ—É–Ω–∫—Ü–∏–∏ zip (). –≠—Ç–æ –∑–≤–µ–∑–¥–æ—á–∫–∞ *, –∏—Å–ø–æ–ª—å–∑—É–µ–º–∞—è –≤–º–µ—Å—Ç–µ —Å —Ñ—É–Ω–∫—Ü–∏–µ–π zip ().

–í–æ—Ç –ø—Ä–∏–º–µ—Ä zip () –æ–ø–µ—Ä–∞—Ç–æ—Ä —Ä–∞—Å–ø–∞–∫–æ–≤–∫–∏ –≤ –¥–µ–π—Å—Ç–≤–∏–∏:

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

–í –ø–µ—Ä–≤–æ–π —Å—Ç—Ä–æ–∫–µ –Ω–∞—à–µ–≥–æ –∫–æ–¥–∞ –º—ã –æ–ø—Ä–µ–¥–µ–ª—è–µ–º –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é, –∫–æ—Ç–æ—Ä–∞—è –≤–∫–ª—é—á–∞–µ—Ç —Å–ø–∏—Å–æ–∫ –∫–æ—Ä—Ç–µ–∂–µ–π. –ó–∞—Ç–µ–º –≤ —Å–ª–µ–¥—É—é—â–µ–π —Å—Ç—Ä–æ–∫–µ –º—ã –æ–ø—Ä–µ–¥–µ–ª—è–µ–º –¥–≤–µ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ. –≠—Ç–∏–º–∏ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–º–∏ —è–≤–ª—è—é—Ç—Å—è employee_names –∏ employee_numbers. –º—ã –Ω–∞–∑–Ω–∞—á–∞–µ–º —ç—Ç–∏–º –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–º –∑–Ω–∞—á–µ–Ω–∏—è –∏–∑ –Ω–∞—à–µ–π —Ñ—É–Ω–∫—Ü–∏–∏ —Ä–∞—Å–ø–∞–∫–æ–≤–∫–∏.

–§—É–Ω–∫—Ü–∏—è unzip - —ç—Ç–æ —Ñ—É–Ω–∫—Ü–∏—è zip, –∫–æ—Ç–æ—Ä–∞—è –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –Ω–∞—à—É –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é employee_zipped, —Ä–∞—Å–ø–∞–∫–æ–≤—ã–≤–∞–µ—Ç zip —Å –ø–æ–º–æ—â—å—é –æ–ø–µ—Ä–∞—Ç–æ—Ä–∞ —Ä–∞—Å–ø–∞–∫–æ–≤–∫–∏ *. –í –ø—Ä–∏–≤–µ–¥–µ–Ω–Ω–æ–º –≤—ã—à–µ –ø—Ä–∏–º–µ—Ä–µ –º—ã —Ä–∞—Å–ø–µ—á–∞—Ç—ã–≤–∞–µ–º –¥–≤–µ –Ω–∞—à–∏ –Ω–æ–≤—ã–µ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ, –∫–æ—Ç–æ—Ä—ã–µ —Å–æ–¥–µ—Ä–∂–∞—Ç –∏–º–µ–Ω–∞ –∏ –Ω–æ–º–µ—Ä–∞ —Å–æ—Ç—Ä—É–¥–Ω–∏–∫–æ–≤.

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

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

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

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