Функция карты Python: пошаговое руководство

| | | |

–§—É–Ω–∫—Ü–∏—è Python map () –≤—ã–ø–æ–ª–Ω—è–µ—Ç —Ñ—É–Ω–∫—Ü–∏—é –¥–ª—è –∫–∞–∂–¥–æ–≥–æ —ç–ª–µ–º–µ–Ω—Ç–∞ –≤ –∫–æ–ª–ª–µ–∫—Ü–∏–∏, –Ω–∞–ø—Ä–∏–º–µ—Ä —Å–ø–∏—Å–∫–∞ –∏–ª–∏ –Ω–∞–±–æ—Ä–∞. –§—É–Ω–∫—Ü–∏—è map () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç —Ñ—É–Ω–∫—Ü–∏—é –∏ –æ–±—ä–µ–∫—Ç –¥–ª—è –ø—Ä–∏–º–µ–Ω–µ–Ω–∏—è, —Å –∫–æ—Ç–æ—Ä—ã–º —Ñ—É–Ω–∫—Ü–∏—è –±—É–¥–µ—Ç —Ä–∞–±–æ—Ç–∞—Ç—å –≤ –∫–∞—á–µ—Å—Ç–≤–µ –∞—Ä–≥—É–º–µ–Ω—Ç–æ–≤.

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

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

–í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ, –∏—Å–ø–æ–ª—å–∑—É—è —Å–µ—Ä–∏—é –ø—Ä–∏–º–µ—Ä–æ–≤, –º—ã –æ–±—Å—É–∂–¥–∞–µ–º, –∫–∞–∫ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ñ—É–Ω–∫—Ü–∏—é map () –≤ Python.

–ò—Ç–µ—Ä–∏—Ä—É–µ–º—ã–µ –æ–±—ä–µ–∫—Ç—ã Python

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

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

–ù–∞—à–∏ < –ü–µ—Ä–µ–º–µ–Ω–Ω–∞—è code> student —Å–æ–¥–µ—Ä–∂–∏—Ç —Å–ø–∏—Å–æ–∫, –∫–æ—Ç–æ—Ä—ã–π —è–≤–ª—è–µ—Ç—Å—è –∏—Ç–µ—Ä–∏—Ä—É–µ–º—ã–º –æ–±—ä–µ–∫—Ç–æ–º. –≠—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ –º—ã –º–æ–∂–µ–º –ø–µ—Ä–µ–º–µ—â–∞—Ç—å—Å—è –ø–æ —ç–ª–µ–º–µ–Ω—Ç–∞–º –≤ —Å–ø–∏—Å–∫–µ. & Nbsp;

–°–∏–Ω—Ç–∞–∫—Å–∏—Å —Ñ—É–Ω–∫—Ü–∏–∏ –∫–∞—Ä—Ç—ã Python

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

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

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

Python map ( ) - —ç—Ç–æ —Ñ—É–Ω–∫—Ü–∏—è –≤—ã—Å—à–µ–≥–æ –ø–æ—Ä—è–¥–∫–∞, –∫–æ—Ç–æ—Ä—É—é –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –¥–ª—è –ø—Ä–∏–º–µ–Ω–µ–Ω–∏—è –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω–æ–π —Ñ—É–Ω–∫—Ü–∏–∏ –∫ –Ω–µ—Å–∫–æ–ª—å–∫–∏–º —ç–ª–µ–º–µ–Ω—Ç–∞–º –≤ –∏—Ç–µ—Ä–∞—Ç–∏–≤–Ω–æ–º –æ–±—ä–µ–∫—Ç–µ. –°–∏–Ω—Ç–∞–∫—Å–∏—Å —Ñ—É–Ω–∫—Ü–∏–∏ Python map () —Å–ª–µ–¥—É—é—â–∏–π:

–ü–µ—Ä–≤—ã–π –∞—Ä–≥—É–º–µ–Ω—Ç, –∫–æ—Ç–æ—Ä—ã–π –ø—Ä–∏–Ω–∏–º–∞–µ—Ç —Ñ—É–Ω–∫—Ü–∏—è map (), - —ç—Ç–æ —Ñ—É–Ω–∫—Ü–∏—è. –≠—Ç–æ —Ñ—É–Ω–∫—Ü–∏—è, –∫–æ—Ç–æ—Ä–∞—è –±—É–¥–µ—Ç –≤—ã–ø–æ–ª–Ω—è—Ç—å—Å—è –¥–ª—è –∫–∞–∂–¥–æ–≥–æ —ç–ª–µ–º–µ–Ω—Ç–∞ –≤ –∏—Ç–µ—Ä–∞—Ü–∏–∏. iterable - —ç—Ç–æ –æ–±—ä–µ–∫—Ç, –∫–æ—Ç–æ—Ä—ã–π –±—É–¥–µ—Ç –æ—Ç–æ–±—Ä–∞–∂–µ–Ω, –Ω–∞–ø—Ä–∏–º–µ—Ä —Å–ø–∏—Å–æ–∫, –∫–æ—Ä—Ç–µ–∂, —Å–ª–æ–≤–∞—Ä—å –∏–ª–∏ –Ω–∞–±–æ—Ä.

–ö–∞–∫ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ñ—É–Ω–∫—Ü–∏—é –∫–∞—Ä—Ç—ã –≤ Python

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

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

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

–í –ø–µ—Ä–≤—ã—Ö –¥–≤—É—Ö —Å—Ç—Ä–æ–∫–∞—Ö –º—ã –æ–±—ä—è–≤–ª—è–µ–º —Ñ—É–Ω–∫—Ü–∏—é Python —Å –∏–º–µ–Ω–µ–º mergeNamesAndGrades. –≠—Ç–∞ —Ñ—É–Ω–∫—Ü–∏—è –æ–±—ä–µ–¥–∏–Ω—è–µ—Ç –∏–º—è –∫–∞–∂–¥–æ–≥–æ —É—á–∞—â–µ–≥–æ—Å—è —Å –ü–µ—Ä–≤–æ–∫–ª–∞—Å—Å–Ω–∏–∫–æ–º. & Nbsp;

–ó–∞—Ç–µ–º –≤ —Å–ª–µ–¥—É—é—â–µ–π —Å—Ç—Ä–æ–∫–µ –º—ã –æ–ø—Ä–µ–¥–µ–ª—è–µ–º —Å–ø–∏—Å–æ–∫ —É—á–∞—â–∏—Ö—Å—è –≤ –Ω–∞—à–µ–π —à–∫–æ–ª–µ. –í –Ω–∞—à–µ–º —Å–ø–∏—Å–∫–µ –ø—è—Ç—å —Å—Ç—É–¥–µ–Ω—Ç–æ–≤.

–§—É–Ω–∫—Ü–∏—è map () –ø—Ä–∏–º–µ–Ω—è–µ—Ç—Å—è –∫ —Å–æ–¥–µ—Ä–∂–∏–º–æ–º—É student_roster –ø–µ—Ä–µ–º–µ–Ω–Ω–∞—è Python . –§—É–Ω–∫—Ü–∏—è map () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –¥–≤–∞ –∞—Ä–≥—É–º–µ–Ω—Ç–∞: —Ñ—É–Ω–∫—Ü–∏—é (–≤ –¥–∞–Ω–Ω–æ–º —Å–ª—É—á–∞–µ mergeNamesAndGrades) –∏ –ø–æ–≤—Ç–æ—Ä—è–µ–º—ã–π –æ–±—ä–µ–∫—Ç (—Å—Ç—É–¥–µ–Ω—Ç—ã). & Nbsp;

–ú–µ—Ç–æ–¥ map () –ø—Ä–∏–º–µ–Ω—è–µ—Ç —Ñ—É–Ω–∫—Ü–∏—é mergeNamesAndGrades () –∫ –∫–∞–∂–¥–æ–º—É —É—á–∞—â–µ–º—É—Å—è. –≤ –Ω–∞—à–µ–º —Å–ø–∏—Å–∫–µ.

–ü—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞–Ω–∏–µ –∫–∞—Ä—Ç—ã Python –≤ —Å–ø–∏—Å–æ–∫

–û–¥–Ω–∞–∫–æ –Ω–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –µ—â–µ –Ω–µ –∑–∞–≤–µ—Ä—à–µ–Ω–∞. –§—É–Ω–∫—Ü–∏—è map () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Å–æ–ø–æ—Å—Ç–∞–≤–ª–µ–Ω–Ω—ã–π –æ–±—ä–µ–∫—Ç, –∞ –Ω–µ –Ω–∞—à –ø–æ–ª–Ω—ã–π —Å–ø–∏—Å–æ–∫. –ï—Å–ª–∏ –º—ã –ø—Ä—è–º–æ —Å–µ–π—á–∞—Å —Ä–∞—Å–ø–µ—á–∞—Ç–∞–µ–º –Ω–∞—à—É –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é student_roster, –Ω–∞—à –∫–æ–¥ –≤–µ—Ä–Ω–µ—Ç —Å–æ–ø–æ—Å—Ç–∞–≤–ª–µ–Ω–Ω—ã–π –æ–±—ä–µ–∫—Ç —Å–ª–µ–¥—É—é—â–∏–º –æ–±—Ä–∞–∑–æ–º:

–≠—Ç–æ—Ç –≤—ã–≤–æ–¥ –±—ã–ª —Å–æ–∑–¥–∞–Ω, –ø–æ—Ç–æ–º—É —á—Ç–æ —Ñ—É–Ω–∫—Ü–∏—è map () –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Å–≤–æ–π —Å–æ–±—Å—Ç–≤–µ–Ω–Ω—ã–π –Ω–∞—Å—Ç—Ä–∞–∏–≤–∞–µ–º—ã–π –æ–±—ä–µ–∫—Ç, –∞ –Ω–µ —Å–ø–∏—Å–æ–∫ . –ò—Ç–∞–∫, –µ—Å–ª–∏ –º—ã —Ö–æ—Ç–∏–º —Ä–∞—Å–ø–µ—á–∞—Ç–∞—Ç—å —Å–ø–∏—Å–æ–∫ –∏–º–µ–Ω —Å—Ç—É–¥–µ–Ω—Ç–æ–≤, –Ω–∞–º –Ω—É–∂–Ω–æ –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å –Ω–∞—à—É –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é student_roster –≤ —Å–ø–∏—Å–æ–∫. –í–æ—Ç –∫–æ–¥, –∫–æ—Ç–æ—Ä—ã–π –º—ã –º–æ–∂–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –¥–ª—è –≤—ã–ø–æ–ª–Ω–µ–Ω–∏—è —ç—Ç–æ–≥–æ –¥–µ–π—Å—Ç–≤–∏—è:

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

–†–∞—Å—Å–º–æ—Ç—Ä–∏–º –¥—Ä—É–≥–æ–π –ø—Ä–∏–º–µ—Ä. –î–æ–ø—É—Å—Ç–∏–º, –º—ã —Ö–æ—Ç–∏–º –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞—Ç—å –∏–º—è –∏ –æ—Ü–µ–Ω–∫—É –∫–∞–∂–¥–æ–≥–æ —É—á–∞—â–µ–≥–æ—Å—è –≤ –≤–µ—Ä—Ö–Ω–∏–π —Ä–µ–≥–∏—Å—Ç—Ä –¥–ª—è –Ω–∞—à–µ–≥–æ —Å–ø–∏—Å–∫–∞ —É—á–∞—â–∏—Ö—Å—è. –ú—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Å–ª–µ–¥—É—é—â–∏–π –∫–æ–¥, —á—Ç–æ–±—ã –∏–∑–º–µ–Ω–∏—Ç—å —Ä–µ–≥–∏—Å—Ç—Ä –∏–º–µ–Ω —É—á–∞—â–∏—Ö—Å—è –∏ –æ—Ü–µ–Ω–æ–∫:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Å–ø–∏—Å–æ–∫, –ø–æ –∫–æ—Ç–æ—Ä–æ–º—É –º—ã –º–æ–∂–µ–º –≤—ã–ø–æ–ª–Ω–∏—Ç—å –∏—Ç–µ—Ä–∞—Ü–∏—é:

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

–ù–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–ª–∞ —Ñ—É–Ω–∫—Ü–∏—é map () –¥–ª—è –≤—ã–∑–æ–≤–∞ changeCase () –¥–ª—è –∫–∞–∂–¥–æ–≥–æ –æ–±—ä–µ–∫—Ç–∞ –≤ –Ω–∞—à–µ–º –∏—Ç–µ—Ä–∞—Ç–∏–≤–Ω–æ–º < em> student_roster. –ù–∞–∫–æ–Ω–µ—Ü, –Ω–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –≤–µ—Ä–Ω—É–ª–∞ –∏—Å–ø—Ä–∞–≤–ª–µ–Ω–Ω—ã–π —Å–ø–∏—Å–æ–∫ –∏–º–µ–Ω —Å—Ç—É–¥–µ–Ω—Ç–æ–≤ –∑–∞–≥–ª–∞–≤–Ω—ã–º–∏ –±—É–∫–≤–∞–º–∏.

–§—É–Ω–∫—Ü–∏—è Python Map —Å Lambda

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

< p> –ù–æ –µ—Å–ª–∏ –º—ã —Ö–æ—Ç–∏–º –≤—ã–ø–æ–ª–Ω–∏—Ç—å –¥–µ–π—Å—Ç–≤–∏–µ —Å –∏—Ç–µ—Ä–∏—Ä—É–µ–º—ã–º –æ–±—ä–µ–∫—Ç–æ–º —Ç–æ–ª—å–∫–æ –æ–¥–∏–Ω —Ä–∞–∑, –æ–±—ä—è–≤–ª—è—Ç—å –Ω–æ–≤—É—é —Ñ—É–Ω–∫—Ü–∏—é –Ω–µ–æ–±—è–∑–∞—Ç–µ–ª—å–Ω–æ. –í–º–µ—Å—Ç–æ —ç—Ç–æ–≥–æ –º—ã –º–æ–∂–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –ª—è–º–±–¥–∞-—Ñ—É–Ω–∫—Ü–∏—é Python, –∫–æ—Ç–æ—Ä–∞—è –ø—Ä–µ–¥—Å—Ç–∞–≤–ª—è–µ—Ç —Å–æ–±–æ–π –Ω–µ–±–æ–ª—å—à—É—é –∞–Ω–æ–Ω–∏–º–Ω—É—é —Ñ—É–Ω–∫—Ü–∏—é.

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

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

< p> –õ—è–º–±–¥–∞-—Ñ—É–Ω–∫—Ü–∏–∏ –º–æ–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Å map () –¥–ª—è –Ω–µ–±–æ–ª—å—à–∏—Ö —Ñ—É–Ω–∫—Ü–∏–π, –≥–¥–µ –º—ã –Ω–µ —Ö–æ—Ç–∏–º –æ–ø—Ä–µ–¥–µ–ª—è—Ç—å –Ω–æ–≤—É—é —Ñ—É–Ω–∫—Ü–∏—é. .

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

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

–ú—ã –Ω–µ –æ–±—ä—è–≤–∏—Ç—å –Ω–æ–≤—É—é —Ñ—É–Ω–∫—Ü–∏—é –¥–ª—è –ø—Ä–µ–æ–±—Ä–∞–∑–æ–≤–∞–Ω–∏—è —Ä–µ–≥–∏—Å—Ç—Ä–∞ –∏–º–µ–Ω –Ω–∞—à–∏—Ö —Å—Ç—É–¥–µ–Ω—Ç–æ–≤ –≤ –≤–µ—Ä—Ö–Ω–∏–π —Ä–µ–≥–∏—Å—Ç—Ä. –í–º–µ—Å—Ç–æ —ç—Ç–æ–≥–æ –º—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–ª–∏ lambda s: s.upper (), –Ω–µ–±–æ–ª—å—à—É—é –∞–Ω–æ–Ω–∏–º–Ω—É—é —Ñ—É–Ω–∫—Ü–∏—é, –∫–æ—Ç–æ—Ä–∞—è –ø—Ä–µ–æ–±—Ä–∞–∑—É–µ—Ç —Ä–µ–≥–∏—Å—Ç—Ä—ã –∏–º–µ–Ω –Ω–∞—à–∏—Ö —É—á–∞—â–∏—Ö—Å—è. & Nbsp;

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

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

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

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

–¢–µ–ø–µ—Ä—å —É –≤–∞—Å –µ—Å—Ç—å –ó–Ω–∞–Ω–∏–µ Python , —á—Ç–æ–±—ã –Ω–∞—á–∞—Ç—å –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å map () –∫–∞–∫ –ø—Ä–æ—Ñ–µ—Å—Å–∏–æ–Ω–∞–ª.

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

News


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