Python Super: практическое руководство

| | | |

–ú–µ—Ç–æ–¥ Python super () –ø–æ–∑–≤–æ–ª—è–µ—Ç –ø–æ–ª—É—á–∞—Ç—å –¥–æ—Å—Ç—É–ø –∫ –º–µ—Ç–æ–¥–∞–º —Ä–æ–¥–∏—Ç–µ–ª—å—Å–∫–æ–≥–æ –∫–ª–∞—Å—Å–∞ –∏–∑ –¥–æ—á–µ—Ä–Ω–µ–≥–æ –∫–ª–∞—Å—Å–∞. –≠—Ç–æ –ø–æ–º–æ–≥–∞–µ—Ç —É–º–µ–Ω—å—à–∏—Ç—å –∫–æ–ª–∏—á–µ—Å—Ç–≤–æ –ø–æ–≤—Ç–æ—Ä–µ–Ω–∏–π –≤ –≤–∞—à–µ–º –∫–æ–¥–µ. super () –Ω–µ –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –Ω–∏–∫–∞–∫–∏—Ö –∞—Ä–≥—É–º–µ–Ω—Ç–æ–≤.

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

–ü—Ä–∏ –ø–æ–≤—Ç–æ—Ä–Ω–æ–º –Ω–∞—Å–ª–µ–¥–æ–≤–∞–Ω–∏–∏ –∫–ª–∞—Å—Å–æ–≤ –≤—ã –º–æ–∂–µ—Ç–µ –∑–∞—Ö–æ—Ç–µ—Ç—å –ø–æ–ª—É—á–∏—Ç—å –¥–æ—Å—Ç—É–ø –∫ –º–µ—Ç–æ–¥–∞–º —Ä–æ–¥–∏—Ç–µ–ª—å—Å–∫–æ–≥–æ –∫–ª–∞—Å—Å–∞. –ó–¥–µ—Å—å –∏ –ø–æ—è–≤–ª—è–µ—Ç—Å—è —Ñ—É–Ω–∫—Ü–∏—è super ().

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

–ß—Ç–æ —Ç–∞–∫–æ–µ Python Super?

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

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

–ú–µ—Ç–æ–¥ super () –Ω–µ –ø—Ä–∏–Ω–∏–º–∞–µ—Ç –Ω–∏–∫–∞–∫–∏—Ö –∞—Ä–≥—É–º–µ–Ω—Ç–æ–≤. –í—ã —É–∫–∞–∑—ã–≤–∞–µ—Ç–µ –º–µ—Ç–æ–¥, –∫–æ—Ç–æ—Ä—ã–π —Ö–æ—Ç–∏—Ç–µ –Ω–∞—Å–ª–µ–¥–æ–≤–∞—Ç—å, –ø–æ—Å–ª–µ –º–µ—Ç–æ–¥–∞ super (). –í—ã—à–µ—É–ø–æ–º—è–Ω—É—Ç—ã–π –∫–ª–∞—Å—Å Python Cheese –Ω–∞—Å–ª–µ–¥—É–µ—Ç –∑–Ω–∞—á–µ–Ω–∏—è –æ—Ç –º–µ—Ç–æ–¥–∞ __init __ () –∫–ª–∞—Å—Å–∞ Food. –ú—ã –≤—ã–∑—ã–≤–∞–µ–º –º–µ—Ç–æ–¥ –∫–ª–∞—Å—Å–∞ super () –¥–ª—è –Ω–∞—Å–ª–µ–¥–æ–≤–∞–Ω–∏—è –∑–Ω–∞—á–µ–Ω–∏–π –æ—Ç –∫–ª–∞—Å—Å–∞ Food.

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

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

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

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

–í Python —Å—É—â–µ—Å—Ç–≤—É–µ—Ç –¥–≤–∞ —Ç–∏–ø–∞ –∫–ª–∞—Å—Å–æ–≤:

  • –î–æ—á–µ—Ä–Ω–∏–µ –∫–ª–∞—Å—Å—ã (–∏–ª–∏ " –ø–æ–¥–∫–ª–∞—Å—Å—ã ") –Ω–∞—Å–ª–µ–¥—É—é—Ç –º–µ—Ç–æ–¥—ã –∏ –ø–µ—Ä–µ–º–µ–Ω–Ω—ã–µ. –î–æ—á–µ—Ä–Ω–∏–π –∫–ª–∞—Å—Å –∏–Ω–æ–≥–¥–∞ –Ω–∞–∑—ã–≤–∞—é—Ç —Ä–æ–¥—Å—Ç–≤–µ–Ω–Ω—ã–º–∏ –∫–ª–∞—Å—Å–∞–º–∏.
  • –†–æ–¥–∏—Ç–µ–ª—å—Å–∫–∏–µ –∫–ª–∞—Å—Å—ã (–∏–ª–∏ " –±–∞–∑–æ–≤—ã–µ –∫–ª–∞—Å—Å—ã ") - —ç—Ç–æ –∫–ª–∞—Å—Å—ã, –∑–Ω–∞—á–µ–Ω–∏—è –∫–æ—Ç–æ—Ä—ã—Ö –º–æ–≥—É—Ç –±—ã—Ç—å —É–Ω–∞—Å–ª–µ–¥–æ–≤–∞–Ω—ã.

super () Python: –Ω–∞—Å–ª–µ–¥–æ–≤–∞—Ç—å –æ—Ç __init __ ()

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

–≠—Ç–æ—Ç –∫–æ–¥ —Å–æ–∑–¥–∞–µ—Ç —Å—Ö–µ–º—É —Ç–µ–∫—É—â–µ–≥–æ —Å—á–µ—Ç–∞.

–¢–µ–ø–µ—Ä—å –ø—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, —á—Ç–æ –º—ã —Ö–æ—Ç–∏–º —Å–æ–∑–¥–∞—Ç—å –∫–ª–∞—Å—Å, –≤ –∫–æ—Ç–æ—Ä–æ–º —Ö—Ä–∞–Ω–∏—Ç—Å—è –ø–ª–∞–Ω –¥–æ—á–µ—Ä–Ω–∏—Ö –±–∞–Ω–∫–æ–≤—Å–∫–∏—Ö —Å—á–µ—Ç–æ–≤, –∫–æ—Ç–æ—Ä—ã–π –º—ã –Ω–∞–∑–æ–≤–µ–º ChildAccount. –ö–ª–∞—Å—Å –¥–æ–ª–∂–µ–Ω –±—ã—Ç—å –æ—Å–Ω–æ–≤–∞–Ω –Ω–∞ –∫–ª–∞—Å—Å–µ CheckingAccount, –∫–æ—Ç–æ—Ä—ã–π –º—ã –æ–ø—Ä–µ–¥–µ–ª–∏–ª–∏ —Ä–∞–Ω–µ–µ. –î–ª—è —ç—Ç–æ–≥–æ –º—ã –º–æ–∂–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ñ—É–Ω–∫—Ü–∏—é super ().

super () –ø–æ–∑–≤–æ–ª—è–µ—Ç –≤–∞–º –ø–æ–ª—É—á–∏—Ç—å –¥–æ—Å—Ç—É–ø –∫ –º–µ—Ç–æ–¥–∞–º —Ä–æ–¥–∏—Ç–µ–ª—å—Å–∫–æ–≥–æ –∫–ª–∞—Å—Å–∞ –≤–Ω—É—Ç—Ä–∏ –¥–æ—á–µ—Ä–Ω–µ–≥–æ –∫–ª–∞—Å—Å–∞.

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

–¢–µ–ø–µ—Ä—å , –ø—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, –º—ã —Ö–æ—Ç–∏–º, —á—Ç–æ–±—ã –∫–ª–∞—Å—Å ChildAccount —É–Ω–∞—Å–ª–µ–¥–æ–≤–∞–ª –∑–Ω–∞—á–µ–Ω–∏—è, —Ö—Ä–∞–Ω—è—â–∏–µ—Å—è –≤ –Ω–∞—à–µ–º CheckingAccount. –ù–æ –º—ã —Ç–∞–∫–∂–µ —Ö–æ—Ç–∏–º, —á—Ç–æ–±—ã —ç—Ç–∞ —É—á–µ—Ç–Ω–∞—è –∑–∞–ø–∏—Å—å —Ö—Ä–∞–Ω–∏–ª–∞ –Ω–æ–≤–æ–µ –∑–Ω–∞—á–µ–Ω–∏–µ —Å –∏–º–µ–Ω–µ–º is_child, –∫–æ—Ç–æ—Ä–æ–µ –ø–æ —É–º–æ–ª—á–∞–Ω–∏—é –¥–æ–ª–∂–Ω–æ –±—ã—Ç—å —Ä–∞–≤–Ω–æ True.

–ú—ã –º–æ–≥–ª–∏ –±—ã —Å–¥–µ–ª–∞—Ç—å –Ω–∞—à –Ω–æ–≤—ã–π ChildAccount –∫–ª–∞—Å—Å, –∏—Å–ø–æ–ª—å–∑—É—é—â–∏–π —ç—Ç–æ—Ç –∫–æ–¥:

–≠—Ç–æ—Ç –∫–æ–¥ —Å–æ–∑–¥–∞–µ—Ç —Å—Ö–µ–º—É –¥–ª—è –Ω–∞—à–µ–≥–æ –Ω–æ–≤–æ–≥–æ –∫–ª–∞—Å—Å–∞ ChildAccount. –ú—ã –∏—Å–ø–æ–ª—å–∑—É–µ–º –º–µ—Ç–æ–¥ super () –¥–ª—è –Ω–∞—Å–ª–µ–¥–æ–≤–∞–Ω–∏—è –∏–º–µ–Ω–∏ –∏ –∑–Ω–∞—á–µ–Ω–∏–π –±–∞–ª–∞–Ω—Å–∞ –æ—Ç –∫–ª–∞—Å—Å–∞ CheckingAccount. –ú—ã —É–∫–∞–∑—ã–≤–∞–µ–º CheckingAccount –≤ –∫–∞—á–µ—Å—Ç–≤–µ —Ä–æ–¥–∏—Ç–µ–ª—å—Å–∫–æ–≥–æ –∫–ª–∞—Å—Å–∞ –≤ –∫—Ä—É–≥–ª—ã—Ö —Å–∫–æ–±–∫–∞—Ö –≤ –ø–µ—Ä–≤–æ–π —Å—Ç—Ä–æ–∫–µ –Ω–∞—à–µ–≥–æ –∫–ª–∞—Å—Å–∞.

–≠—Ç–æ –ø–æ–∫–∞–∑—ã–≤–∞–µ—Ç, —á—Ç–æ super () –ø–æ–∑–≤–æ–ª—è–µ—Ç –≤–∞–º –Ω–∞—Å–ª–µ–¥–æ–≤–∞—Ç—å –≤—Å–µ –∑–Ω–∞—á–µ–Ω–∏—è –∏–∑ –¥—Ä—É–≥–æ–≥–æ –∫–ª–∞—Å—Å–∞. –ù–æ –≤ –Ω–∞—à–µ–º –∫–æ–¥–µ –º—ã —Ç–∞–∫–∂–µ –æ–±—ä—è–≤–∏–ª–∏ –Ω–æ–≤–æ–µ –∑–Ω–∞—á–µ–Ω–∏–µ —Å –∏–º–µ–Ω–µ–º is_child. –≠—Ç–æ –∑–Ω–∞—á–µ–Ω–∏–µ –±—É–¥–µ—Ç –¥–æ—Å—Ç—É–ø–Ω–æ —Ç–æ–ª—å–∫–æ –¥–ª—è –ª—é–±–æ–≥–æ ChildAccount, –ø–æ—Ç–æ–º—É —á—Ç–æ –º—ã –æ–±—ä—è–≤–∏–ª–∏ –µ–≥–æ –≤ –∫–ª–∞—Å—Å–µ ChildAccount.

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

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

–ú—ã –æ–±—ä—è–≤–∏–ª–∏ —ç–∫–∑–µ–º–ø–ª—è—Ä –∫–ª–∞—Å—Å–∞ ChildAccount, –Ω–∞–∑–Ω–∞—á–µ–Ω–Ω–æ–≥–æ –ø–µ—Ä–µ–º–µ–Ω–Ω–æ–π Python lynn. lynn - —ç—Ç–æ –æ–±—ä–µ–∫—Ç –∫–ª–∞—Å—Å–∞, –ø–æ—Ç–æ–º—É —á—Ç–æ –º—ã –æ–±—ä—è–≤–∏–ª–∏ –∑–Ω–∞—á–µ–Ω–∏–µ lynn —Å –ø–æ–º–æ—â—å—é –æ–±—ä–µ–∫—Ç–∞.

–£ —É—á–µ—Ç–Ω–æ–π –∑–∞–ø–∏—Å–∏ Lynn $ 200, –∞ –∑–Ω–∞—á–µ–Ω–∏–µ is_child - True –ø–æ —É–º–æ–ª—á–∞–Ω–∏—é. –ó–∞—Ç–µ–º –º—ã —Ä–∞—Å–ø–µ—á–∞—Ç–∞–ª–∏ –∑–Ω–∞—á–µ–Ω–∏—è name, balance, is_child, —Å–≤—è–∑–∞–Ω–Ω—ã–µ —Å —É—á–µ—Ç–Ω–æ–π –∑–∞–ø–∏—Å—å—é Lynn. –∫–æ–ª–∏—á–µ—Å—Ç–≤–æ. –ú—ã –≤—ã–≤–æ–¥–∏–º —ç—Ç–∏ –∑–Ω–∞—á–µ–Ω–∏—è –Ω–∞ –∫–æ–Ω—Å–æ–ª—å —Å –ø–æ–º–æ—â—å—é –º–µ—Ç–æ–¥–∞ Python print () .

–ü–æ—Ç–æ–º—É —á—Ç–æ –º—ã —É–Ω–∞—Å–ª–µ–¥–æ–≤–∞–ª–∏ name –∏ balance –∏–∑ –∫–ª–∞—Å—Å–∞ CheckingAccount, –º—ã —Å–º–æ–≥–ª–∏ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –∏—Ö –≤ –Ω–∞—à–µ–º –∫–æ–¥–µ. –ù–æ –¥–ª—è —É—á–µ—Ç–Ω–æ–π –∑–∞–ø–∏—Å–∏ –õ–∏–Ω–Ω —Ç–∞–∫–∂–µ –∑–∞–¥–∞–Ω–æ –∑–Ω–∞—á–µ–Ω–∏–µ is_child, –∫–æ—Ç–æ—Ä–æ–µ –ø–æ —É–º–æ–ª—á–∞–Ω–∏—é –∏–º–µ–µ—Ç –∑–Ω–∞—á–µ–Ω–∏–µ True –¥–ª—è –≤—Å–µ—Ö —ç–∫–∑–µ–º–ø–ª—è—Ä–æ–≤ ChildAccount.

super () Python: –º–µ—Ç–æ–¥—ã –Ω–∞—Å–ª–µ–¥–æ–≤–∞–Ω–∏—è

super () –ø–æ–∑–≤–æ–ª—è–µ—Ç –Ω–∞—Å–ª–µ–¥–æ–≤–∞—Ç—å –∫–ª–∞—Å—Å—ã –ª–∏–±–æ —Å –ø–æ–º–æ—â—å—é –æ–¥–Ω–æ—É—Ä–æ–≤–Ω–µ–≤–æ–≥–æ –Ω–∞—Å–ª–µ–¥–æ–≤–∞–Ω–∏—è, & mdash; –Ω–∞—Å–ª–µ–¥—É—è –∫–ª–∞—Å—Å –æ—Ç —Ä–æ–¥–∏—Ç–µ–ª—å—Å–∫–æ–≥–æ –∫–ª–∞—Å—Å–∞. –ò–ª–∏ –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å super () —Å –º–Ω–æ–≥–æ—É—Ä–æ–≤–Ω–µ–≤—ã–º –Ω–∞—Å–ª–µ–¥–æ–≤–∞–Ω–∏–µ–º. –í —ç—Ç–æ–º –ø—Ä–∏–º–µ—Ä–µ –º—ã —Å–æ—Å—Ä–µ–¥–æ—Ç–æ—á–∏–º—Å—è –Ω–∞ –æ–¥–Ω–æ—É—Ä–æ–≤–Ω–µ–≤–æ–º –Ω–∞—Å–ª–µ–¥–æ–≤–∞–Ω–∏–∏ —Å –ø–æ–º–æ—â—å—é super ().

–í –Ω–∞—à–µ–º –ø—Ä–µ–¥—ã–¥—É—â–µ–º –ø—Ä–∏–º–µ—Ä–µ –º—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–ª–∏ super () –¥–ª—è –Ω–∞—Å–ª–µ–¥—É—é—Ç –∑–Ω–∞—á–µ–Ω–∏—è, —Ö—Ä–∞–Ω—è—â–∏–µ—Å—è –≤ –∫–ª–∞—Å—Å–µ CheckingAccount, –∏ –¥–µ–ª–∞—é—Ç –∏—Ö –¥–æ—Å—Ç—É–ø–Ω—ã–º–∏ –≤ –∫–ª–∞—Å—Å–µ ChildAccount. –ù–æ —á—Ç–æ, –µ—Å–ª–∏ –º—ã —Ö–æ—Ç–∏–º —É–Ω–∞—Å–ª–µ–¥–æ–≤–∞—Ç—å –º–µ—Ç–æ–¥ –∏ –∏–∑–º–µ–Ω–∏—Ç—å –µ–≥–æ —Ä–µ–∞–∫—Ü–∏—é?

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

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

–î–∞–≤–∞–π—Ç–µ –≤–µ—Ä–Ω–µ–º—Å—è –∫ –Ω–∞—à–µ–º—É –ö–ª–∞—Å—Å CheckingAccount –∏–∑ –±–æ–ª–µ–µ —Ä–∞–Ω–Ω–µ–≥–æ:

–í —ç—Ç–æ–º –∫–ª–∞—Å—Å–µ –º—ã –æ–ø—Ä–µ–¥–µ–ª–∏–ª–∏ —Å—Ö–µ–º—É –∑–Ω–∞—á–µ–Ω–∏–π, –∫–æ—Ç–æ—Ä—ã–µ –∫–ª–∞—Å—Å –¥–æ–ª–∂–µ–Ω —Ö—Ä–∞–Ω–∏—Ç—å & mdash ; –Ω–∞–∑–≤–∞–Ω–∏–µ –∏ –±–∞–ª–∞–Ω—Å. –ú—ã –æ–ø—Ä–µ–¥–µ–ª–∏–ª–∏ –º–µ—Ç–æ–¥ –ø–æ–¥ –Ω–∞–∑–≤–∞–Ω–∏–µ–º checkBalance (), –∫–æ—Ç–æ—Ä—ã–π –ø–æ–∑–≤–æ–ª—è–µ—Ç –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—é –ø—Ä–æ–≤–µ—Ä—è—Ç—å —Å–≤–æ–π –±–∞–ª–∞–Ω—Å.

–¢–µ–ø–µ—Ä—å –ø—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, —á—Ç–æ –º—ã —Ö–æ—Ç–∏–º —Å–¥–µ–ª–∞—Ç—å checkBalance () –¥–æ—Å—Ç—É–ø–Ω—ã–º –¥–ª—è –Ω–∞—à–µ–≥–æ ChildAccount. –ú—ã —Ç–∞–∫–∂–µ —Ö–æ—Ç–∏–º —Ä–∞—Å–ø–µ—á–∞—Ç–∞—Ç—å —Å–æ–æ–±—â–µ–Ω–∏–µ —Å —É–∫–∞–∑–∞–Ω–∏–µ–º " –í—ã —è–≤–ª—è–µ—Ç–µ—Å—å –≤–ª–∞–¥–µ–ª—å—Ü–µ–º –¥–æ—á–µ—Ä–Ω–µ–π —É—á–µ—Ç–Ω–æ–π –∑–∞–ø–∏—Å–∏! " –≠—Ç–æ –¥–æ–ª–∂–Ω–æ –ø–æ—è–≤–∏—Ç—å—Å—è –¥–æ —Ç–æ–≥–æ, –∫–∞–∫ –±–∞–ª–∞–Ω—Å –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—è –±—É–¥–µ—Ç –Ω–∞–ø–µ—á–∞—Ç–∞–Ω –Ω–∞ –∫–æ–Ω—Å–æ–ª–∏.

–ú—ã –º–æ–≥–ª–∏ –±—ã –ø–æ–ª—É—á–∏—Ç—å –¥–æ—Å—Ç—É–ø –∫ –Ω–∞—à–∏–º —É–Ω–∞—Å–ª–µ–¥–æ–≤–∞–Ω–Ω—ã–º –º–µ—Ç–æ–¥–∞–º —Å–ª–µ–¥—É—é—â–∏–º –æ–±—Ä–∞–∑–æ–º: < / p>

–£ –Ω–∞—Å –µ—Å—Ç—å –æ–±—ä—è–≤–∏–ª –Ω–æ–≤—É—é –≤–µ—Ä—Å–∏—é –º–µ—Ç–æ–¥–∞ checkBalance () –≤ –∫–ª–∞—Å—Å–µ ChildAccount. –≠—Ç–∞ –≤–µ—Ä—Å–∏—è —Å–Ω–∞—á–∞–ª–∞ –≤—ã–≤–æ–¥–∏—Ç " –í—ã —è–≤–ª—è–µ—Ç–µ—Å—å –≤–ª–∞–¥–µ–ª—å—Ü–µ–º –¥–æ—á–µ—Ä–Ω–µ–≥–æ –∞–∫–∫–∞—É–Ω—Ç–∞! " –≤ –∫–æ–Ω—Å–æ–ª—å. –¢–æ–≥–¥–∞ –Ω–∞—à–∏ –∫–æ–¥, –∫–æ—Ç–æ—Ä—ã–π –∏—Å–ø–æ–ª—å–∑—É–µ—Ç super () –¥–ª—è –≤—ã–ø–æ–ª–Ω–µ–Ω–∏—è –º–µ—Ç–æ–¥–∞ checkBalance () –∏–∑ –∫–ª–∞—Å—Å–∞ " parent.

–í —ç—Ç–æ–º —Å–ª—É—á–∞–µ –ø—Ä–∏ –∑–∞–ø—É—Å–∫–µ super (). checkBalance () —Ñ—É–Ω–∫—Ü–∏—è checkBalance () –∏–∑ CheckingAccount –∫–ª–∞—Å—Å –≤—ã–ø–æ–ª–Ω—è–µ—Ç—Å—è. –ü—Ä–∏ —ç—Ç–æ–º –±–∞–ª–∞–Ω—Å –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—è –≤—ã–≤–æ–¥–∏—Ç—Å—è –Ω–∞ –∫–æ–Ω—Å–æ–ª—å.

–¢–µ–ø–µ—Ä—å –¥–∞–≤–∞–π—Ç–µ –ø–æ–ø—Ä–æ–±—É–µ–º –ø–æ–ª—É—á–∏—Ç—å –¥–æ—Å—Ç—É–ø –∫ –Ω–∞—à–µ–º—É –º–µ—Ç–æ–¥—É checkBalance () –¥–ª—è —É—á–µ—Ç–Ω–æ–π –∑–∞–ø–∏—Å–∏ –õ–∏–Ω–Ω:

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

–ö–æ–≥–¥–∞ –º—ã –≤—ã–∑—ã–≤–∞–µ–º –º–µ—Ç–æ–¥ lynn.checkBalance (), –∫–æ–¥ –≤ –Ω–∞—à–µ–º –º–µ—Ç–æ–¥–µ ChildAccount.checkBalance () run, –∞ –∑–∞—Ç–µ–º —Å—É–ø–µ—Ä–æ–±—ä–µ–∫—Ç –≤—ã–ø–æ–ª–Ω—è–µ—Ç –∫–æ–¥ –≤ –º–µ—Ç–æ–¥–µ CheckingAccount.checkBalance ().

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

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

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

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

–î–æ–ø–æ–ª–Ω–∏—Ç–µ–ª—å–Ω—ã–µ —Ä–µ—Å—É—Ä—Å—ã –ø–æ –ø—Ä–æ–≥—Ä–∞–º–º–∏—Ä–æ–≤–∞–Ω–∏—é –Ω–∞ 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