Python Sort (): практическое руководство

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

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

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

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

–°–ø–∏—Å–æ–∫ —Å–æ—Ä—Ç–∏—Ä–æ–≤–∫–∏ Python

–§—É–Ω–∫—Ü–∏—è sort () —É–ø–æ—Ä—è–¥–æ—á–∏–≤–∞–µ—Ç —Å–ø–∏—Å–∫–∏ –≤ –ø–æ—Ä—è–¥–∫–µ –≤–æ–∑—Ä–∞—Å—Ç–∞–Ω–∏—è. –í—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –Ω–∞—Å—Ç—Ä–∞–∏–≤–∞–µ–º—É—é —Å–æ—Ä—Ç–∏—Ä–æ–≤–∫—É –∏–ª–∏ —Å–æ—Ä—Ç–∏—Ä–æ–≤–∫—É –≤ –ø–æ—Ä—è–¥–∫–µ —É–±—ã–≤–∞–Ω–∏—è, —É–∫–∞–∑–∞–≤ –¥–æ–ø–æ–ª–Ω–∏—Ç–µ–ª—å–Ω—ã–µ –ø–∞—Ä–∞–º–µ—Ç—Ä—ã. –≠—Ç–∏ –ø–∞—Ä–∞–º–µ—Ç—Ä—ã —è–≤–ª—è—é—Ç—Å—è –Ω–µ–æ–±—è–∑–∞—Ç–µ–ª—å–Ω—ã–º–∏.

–î–∞–≤–∞–π—Ç–µ –≤–∑–≥–ª—è–Ω–µ–º –Ω–∞ —Å–∏–Ω—Ç–∞–∫—Å–∏—Å –º–µ—Ç–æ–¥–∞ sort ():

–ù–∞—à –º–µ—Ç–æ–¥ sort () –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –¥–≤–∞ –Ω–µ–æ–±—è–∑–∞—Ç–µ–ª—å–Ω—ã—Ö –∞—Ä–≥—É–º–µ–Ω—Ç–∞:

  • reverse: —É–∫–∞–∑–∞–Ω–∏–µ –∑–Ω–∞—á–µ–Ω–∏–µ True —Å–æ—Ä—Ç–∏—Ä—É–µ—Ç —Å–ø–∏—Å–æ–∫ –≤ –ø–æ—Ä—è–¥–∫–µ —É–±—ã–≤–∞–Ω–∏—è.
  • key: —Ñ—É–Ω–∫—Ü–∏—è, —Å–æ—Ä—Ç–∏—Ä—É—é—â–∞—è —Å–ø–∏—Å–æ–∫.

–°–ø–∏—Å–æ–∫ —Å–æ—Ä—Ç–∏—Ä–æ–≤–∫–∏ Python: –≤–æ–∑—Ä–∞—Å—Ç–∞—é—â–∏–π –ø–æ—Ä—è–¥–æ–∫

–ù–∏–∂–µ –º—ã –æ–ø—Ä–µ–¥–µ–ª—è–µ–º –º–∞—Å—Å–∏–≤ Python. –≠—Ç–æ—Ç –º–∞—Å—Å–∏–≤ —Å–æ–¥–µ—Ä–∂–∏—Ç —Å–ø–∏—Å–æ–∫ —á–∏—Å–µ–ª. –≠—Ç–∏ —á–∏—Å–ª–∞ –Ω–µ —Ä–∞—Å–ø–æ–ª–æ–∂–µ–Ω—ã –≤ –∫–∞–∫–æ–º-–ª–∏–±–æ –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω–æ–º –ø–æ—Ä—è–¥–∫–µ. –ß—Ç–æ–±—ã –æ—Ç—Å–æ—Ä—Ç–∏—Ä–æ–≤–∞—Ç—å –Ω–∞—à –º–∞—Å—Å–∏–≤, –º—ã –º–æ–∂–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ñ—É–Ω–∫—Ü–∏—é sort ():

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

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

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

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

–ó–∞—Ç–µ–º –º—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º —Ñ—É–Ω–∫—Ü–∏—é sort () –±–µ–∑ –∞—Ä–≥—É–º–µ–Ω—Ç–æ–≤. –≠—Ç–æ —É–ø–æ—Ä—è–¥–æ—á–∏–≤–∞–µ—Ç –Ω–∞—à –∏—Å—Ö–æ–¥–Ω—ã–π —Å–ø–∏—Å–æ–∫ –≤ –≤–æ–∑—Ä–∞—Å—Ç–∞—é—â–µ–º –∞–ª—Ñ–∞–≤–∏—Ç–Ω–æ–º –ø–æ—Ä—è–¥–∫–µ. –ó–∞—Ç–µ–º –≤ –ø–æ—Å–ª–µ–¥–Ω–µ–π —Å—Ç—Ä–æ–∫–µ –Ω–∞—à –∫–æ–¥ –ø–µ—á–∞—Ç–∞–µ—Ç –æ—Ç—Å–æ—Ä—Ç–∏—Ä–æ–≤–∞–Ω–Ω—ã–µ –¥–∞–Ω–Ω—ã–µ.

–§—É–Ω–∫—Ü–∏—è sort () –¥–µ–π—Å—Ç–≤–∏—Ç–µ–ª—å–Ω–æ –∏–∑–º–µ–Ω—è–µ—Ç –Ω–∞—à –∏—Å—Ö–æ–¥–Ω—ã–π –º–∞—Å—Å–∏–≤ .

–°–ø–∏—Å–æ–∫ —Å–æ—Ä—Ç–∏—Ä–æ–≤–∫–∏ –≤ Python: –ø–æ —É–±—ã–≤–∞–Ω–∏—é

–ê—Ä–≥—É–º–µ–Ω—Ç reverse —Å–æ—Ä—Ç–∏—Ä—É–µ—Ç —Å–ø–∏—Å–æ–∫ –≤ –ø–æ—Ä—è–¥–∫–µ —É–±—ã–≤–∞–Ω–∏—è, –µ—Å–ª–∏ –¥–ª—è –Ω–µ–≥–æ —É—Å—Ç–∞–Ω–æ–≤–ª–µ–Ω–æ –∑–Ω–∞—á–µ–Ω–∏–µ True. –ü–æ —É–º–æ–ª—á–∞–Ω–∏—é —É—Å—Ç–∞–Ω–æ–≤–ª–µ–Ω–æ –∑–Ω–∞—á–µ–Ω–∏–µ reverse. –Ω–∞ False, —á—Ç–æ –æ–∑–Ω–∞—á–∞–µ—Ç, —á—Ç–æ –Ω–∞—à –æ–∫–æ–Ω—á–∞—Ç–µ–ª—å–Ω—ã–π —Å–ø–∏—Å–æ–∫ –±—É–¥–µ—Ç –≤ –≤–æ–∑—Ä–∞—Å—Ç–∞—é—â–µ–º –ø–æ—Ä—è–¥–∫–µ.

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

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —Å–ø–∏—Å–æ–∫ –∏–º–µ–Ω —Å—Ç—É–¥–µ–Ω—Ç–æ–≤ –≤ –æ–±—Ä–∞—Ç–Ω–æ–º –∞–ª—Ñ–∞–≤–∏—Ç–Ω–æ–º –ø–æ—Ä—è–¥–∫–µ:

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

–°–æ—Ä—Ç–∏—Ä–æ–≤–∞—Ç—å –ø–æ –¥–ª–∏–Ω–µ —Å—Ç—Ä–æ–∫–∏

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

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

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

–í –Ω–∞—à–µ–º –ø—Ä–∏–º–µ—Ä–µ –≤—ã—à–µ –º—ã —É–∫–∞–∑—ã–≤–∞–µ–º –Ω–∞—à–µ–º—É –∫–æ–¥—É —Å–æ—Ä—Ç–∏—Ä–æ–≤–∫—É –ø–æ len (), –∫–æ—Ç–æ—Ä–∞—è —è–≤–ª—è–µ—Ç—Å—è –≤—Å—Ç—Ä–æ–µ–Ω–Ω–æ–π —Ñ—É–Ω–∫—Ü–∏–µ–π Python –¥–ª—è –¥–ª–∏–Ω—ã –æ–±—ä–µ–∫—Ç–∞ < / –∞>. –ö–∞–∂–¥–∞—è —Å—Ç—Ä–æ–∫–∞ –≤ –Ω–∞—à–µ–º –º–∞—Å—Å–∏–≤–µ –ø—Ä–æ—Ö–æ–¥–∏—Ç —á–µ—Ä–µ–∑ len (). –ó–∞—Ç–µ–º —É–ø–æ—Ä—è–¥–æ—á–∏–≤–∞–µ—Ç—Å—è –æ–∫–æ–Ω—á–∞—Ç–µ–ª—å–Ω—ã–π —Å–ø–∏—Å–æ–∫.

–¢–æ—á–Ω–æ —Ç–∞–∫ –∂–µ –º—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å str.upper –¥–ª—è —Å–æ—Ä—Ç–∏—Ä–æ–≤–∫–∏ –≤ –∞–ª—Ñ–∞–≤–∏—Ç–Ω–æ–º –ø–æ—Ä—è–¥–∫–µ –ø–æ –∑–∞–≥–ª–∞–≤–Ω–æ–π –±—É–∫–≤–µ –≤ –∫–∞–∂–¥–æ–π —Å—Ç—Ä–æ–∫–µ. –ò–ª–∏ –º—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –¥—Ä—É–≥–æ–π Python –¥–ª—è —Å–æ—Ä—Ç–∏—Ä–æ–≤–∫–∏ –Ω–∞—à–µ–≥–æ —Å–ø–∏—Å–∫–∞.

–°–æ—Ä—Ç–∏—Ä–æ–≤–∫–∞ –ø–æ —Å–æ–¥–µ—Ä–∂–∏–º–æ–º—É JSON

–ö–ª—é—á–∏ —Ç–∞–∫–∂–µ –ø–æ–∑–≤–æ–ª—è—é—Ç –≤–∞–º –æ–ø—Ä–µ–¥–µ–ª—è—Ç—å —Å–≤–æ–∏ —Å–æ–±—Å—Ç–≤–µ–Ω–Ω—ã–µ —Ñ—É–Ω–∫—Ü–∏–∏, –∫–æ—Ç–æ—Ä—ã–µ –æ–ø—Ä–µ–¥–µ–ª—è—é—Ç, –∫–∞–∫ –¥–æ–ª–∂–Ω–∞ –≤—ã–ø–æ–ª–Ω—è—Ç—å—Å—è —Å–æ—Ä—Ç–∏—Ä–æ–≤–∫–∞. –í–æ—Ç –ø—Ä–∏–º–µ—Ä sort, –∫–æ—Ç–æ—Ä—ã–π –ø–µ—Ä–µ–≤–µ—Ä–Ω–µ—Ç –º–∞—Å—Å–∏–≤ JSON –Ω–∞ –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω–æ–µ –∑–Ω–∞—á–µ–Ω–∏–µ. –í —ç—Ç–æ–º —Å–ª—É—á–∞–µ —Ä–µ–∑—É–ª—å—Ç–∞—Ç—ã —Ç–µ—Å—Ç–æ–≤ –æ–ø—Ä–µ–¥–µ–ª–µ–Ω–Ω—ã—Ö —Å—Ç—É–¥–µ–Ω—Ç–æ–≤:

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

–ù–∞—à –∫–æ–¥ –æ—Ç—Å–æ—Ä—Ç–∏—Ä–æ–≤–∞–ª —É—á–∞—â–∏—Ö—Å—è –ø–æ –∏—Ö —Ä–µ–∑—É–ª—å—Ç–∞—Ç–∞–º —Ç–µ—Å—Ç–æ–≤. .

–í–æ-–ø–µ—Ä–≤—ã—Ö, –Ω–∞—à–∞ –ø—Ä–æ–≥—Ä–∞–º–º–∞ –æ–ø—Ä–µ–¥–µ–ª—è–µ—Ç —Ñ—É–Ω–∫—Ü–∏—é —Å –∏–º–µ–Ω–µ–º sortFunction, –∫–æ—Ç–æ—Ä–∞—è –ø—Ä–∏ –≤—ã–∑–æ–≤–µ —Å–æ—Ä—Ç–∏—Ä—É–µ—Ç –Ω–∞—à –º–∞—Å—Å–∏–≤ JSON –Ω–∞ –æ—Å–Ω–æ–≤–µ –∑–Ω–∞—á–µ–Ω–∏—è test_score. –ó–∞—Ç–µ–º –º—ã –æ–±—ä—è–≤–ª—è–µ–º –º–∞—Å—Å–∏–≤ JSON —Å –∏–º–µ–Ω–µ–º student —Å –∏–º–µ–Ω–∞–º–∏ —Å—Ç—É–¥–µ–Ω—Ç–æ–≤ –∏ –∏—Ö –æ—Ü–µ–Ω–∫–∞–º–∏ –∑–∞ —Ç–µ—Å—Ç—ã.

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

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

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

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

–ß—Ç–æ–±—ã —É–∑–Ω–∞—Ç—å –±–æ–ª—å—à–µ –æ –∫–æ–¥–∏—Ä–æ–≤–∞–Ω–∏–∏ –Ω–∞ Python, –ø—Ä–æ—á–∏—Ç–∞–π—Ç–µ –Ω–∞—à–µ –ø–æ–ª–Ω–æ–µ —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–æ –ø–æ –∫–∞–∫ –∏–∑—É—á–∏—Ç—å 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