✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

🤑 Join the Treehouse affiliate program and earn 25% recurring commission!

New No-Code Track! 🚀start learning today!

🌟 Dreaming of a bright future? 🎓 Ask about the Treehouse Scholarship program! 🚀

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

🤑 Join the Treehouse affiliate program and earn 25% recurring commission!

  • Treehouse Logo
  • Plans
    Chevron
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
  • Library
    Chevron
    • All Courses
    • Tracks
    • College Credit
  • Techdegree
    Chevron
    • Overview
    • Front End Development
    • Full Stack JavaScript
    • Data Analysis
    • UX Design
    • Python
  • Community
    Chevron
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
  • Resources
    Chevron
    • Career Toolbox
    • CodeForward
    • Free Treehouse Near Me
    • Jobs
    • Blog
    • Support
    • About
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks College Credit
  • Overview Front End Web Development Full Stack JavaScript Python Development Data Analysis UX Design
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Career Toolbox CodeForward Free Treehouse Near Me Jobs Blog Support About
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • Android
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
    • Showing results for:
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins
    • Close
  • JASON LEE
    JASON LEE
    17,352 Points

    Law of Demeter principle at @3:05 ?

    Posted on Dec 23, 2023 by JASON LEE
    JASON LEE
    17,352 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Cameron Ganley
    Cameron Ganley
    4,049 Points

    Wrong workspace opening

    Posted on Oct 27, 2023 by Cameron Ganley
    Cameron Ganley
    4,049 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    3 Answers

  • Gene Higgins
    Gene Higgins
    16,582 Points

    items.py is missing from the workspace

    Posted on May 17, 2021 by Gene Higgins
    Gene Higgins
    16,582 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Adrian Diaz
    Adrian Diaz
    3,500 Points

    Why do we need to make our own built in dunder function __len__ when the len() function works just fine?

    Posted on Oct 16, 2020 by Adrian Diaz
    Adrian Diaz
    3,500 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    3 Answers

  • E. T.
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    E. T.
    Python Development Techdegree Student 884 Points

    when to use dunder and when not to?

    Posted on Sep 29, 2020 by E. T.
    .a{fill-rule:evenodd;}techdegree
    E. T.
    Python Development Techdegree Student 884 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • E. T.
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    E. T.
    Python Development Techdegree Student 884 Points

    How to print inventory as a list rather than printing its items one at a time?

    Posted on Sep 29, 2020 by E. T.
    .a{fill-rule:evenodd;}techdegree
    E. T.
    Python Development Techdegree Student 884 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    3 Answers

  • Adem Gun
    Adem Gun
    1,511 Points

    I'm having trouble grasping most of what's going on, should I keep going?

    Posted on Sep 7, 2020 by Adem Gun
    Adem Gun
    1,511 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Benyamin Kohanchi
    PLUS
    Benyamin Kohanchi
    Courses Plus Student 2,342 Points

    Quick question about Kenneth assigning the class Inventory() = inventory in the repl (2:35)...

    Posted on Aug 4, 2020 by Benyamin Kohanchi
    Benyamin Kohanchi
    Courses Plus Student 2,342 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Benyamin Kohanchi
    PLUS
    Benyamin Kohanchi
    Courses Plus Student 2,342 Points

    The difference between dunder len and len()

    Posted on Aug 4, 2020 by Benyamin Kohanchi
    Benyamin Kohanchi
    Courses Plus Student 2,342 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Elena Chen
    Elena Chen
    1,503 Points

    self.slots

    Posted on May 24, 2020 by Elena Chen
    Elena Chen
    1,503 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Patrick Brusven
    Patrick Brusven
    14,520 Points

    Can someone explain "cd rpg" at 2:10 in this video, also expand on interactive mode vs importing in the console?

    Posted on May 5, 2020 by Patrick Brusven
    Patrick Brusven
    14,520 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Timothy Tseng
    Timothy Tseng
    3,292 Points

    Is the only reason why yield is used in this example is because it's more memory efficient?

    Posted on Mar 28, 2020 by Timothy Tseng
    Timothy Tseng
    3,292 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Antoni Majewski
    Antoni Majewski
    3,128 Points

    len() vs. __len__

    Posted on Nov 4, 2019 by Antoni Majewski
    Antoni Majewski
    3,128 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    2 Answers

  • Sohail Mirza
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Sohail Mirza
    Python Web Development Techdegree Student 5,158 Points

    why don't we put slots as a argument

    Posted on Oct 17, 2019 by Sohail Mirza
    .a{fill-rule:evenodd;}techdegree
    Sohail Mirza
    Python Web Development Techdegree Student 5,158 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • daniel steinberg
    daniel steinberg
    14,651 Points

    Sorted Inventory

    Posted on Oct 8, 2019 by daniel steinberg
    daniel steinberg
    14,651 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Andrew Bickham
    Andrew Bickham
    1,461 Points

    Inventory

    Posted on Sep 27, 2019 by Andrew Bickham
    Andrew Bickham
    1,461 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    3 Answers

  • Ivan Frances Alcantara
    Ivan Frances Alcantara
    4,528 Points

    Why does sword.description return only sharp? (min 7:25)

    Posted on Sep 14, 2019 by Ivan Frances Alcantara
    Ivan Frances Alcantara
    4,528 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • wwallace
    wwallace
    2,673 Points

    AttributeError: 'Inventory' object has no attribute 'add'

    Posted on Jul 5, 2019 by wwallace
    wwallace
    2,673 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    3 Answers

  • Wes House
    Wes House
    6,944 Points

    Getting error: "'Inventory' object has no attribute 'slots'"

    Posted on Nov 24, 2018 by Wes House
    Wes House
    6,944 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Pitrov Secondary
    Pitrov Secondary
    5,121 Points

    why did he do inventory = Inventory() at 04.01?

    Posted on Nov 19, 2018 by Pitrov Secondary
    Pitrov Secondary
    5,121 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Iulia Maria Lungu
    Iulia Maria Lungu
    19,302 Points

    Why is yield memory efficient?

    Posted on Nov 18, 2018 by Iulia Maria Lungu
    Iulia Maria Lungu
    19,302 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Maximilian Tan
    Maximilian Tan
    5,570 Points

    'Inventory' object is not iterable

    Posted on Sep 7, 2018 by Maximilian Tan
    Maximilian Tan
    5,570 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • Swan The Human
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Swan The Human
    Full Stack JavaScript Techdegree Student 19,338 Points

    Getting error code play.py python: can't open file 'play.py': [Errno 2] No such file or directory

    Posted on Sep 1, 2018 by Swan The Human
    .a{fill-rule:evenodd;}techdegree
    Swan The Human
    Full Stack JavaScript Techdegree Student 19,338 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • shaik hurera
    shaik hurera
    276 Points

    where is item.py in the workplace? It is not exist

    Posted on Aug 12, 2018 by shaik hurera
    shaik hurera
    276 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    4 Answers

  • François Morlane-Hondere
    François Morlane-Hondere
    1,606 Points

    Why not make the Inventory class a subclass of list?

    Posted on Jul 19, 2018 by François Morlane-Hondere
    François Morlane-Hondere
    1,606 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    2 Answers

  • Jack Cummins
    Jack Cummins
    17,417 Points

    Why are the things in this video even important?

    Posted on Jun 16, 2018 by Jack Cummins
    Jack Cummins
    17,417 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • anupama shah
    anupama shah
    341 Points

    Confusion in code

    Posted on May 30, 2018 by anupama shah
    anupama shah
    341 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

  • annecalija
    annecalija
    9,031 Points

    In numstring.py, why is the implementation of __radd__ different from __add__?

    Posted on Sep 26, 2017 by annecalija
    annecalija
    9,031 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    2 Answers

  • Eddy Hood
    Eddy Hood
    10,154 Points

    Why not use generators all the time?

    Posted on Jun 27, 2017 by Eddy Hood
    Eddy Hood
    10,154 Points
    • Python
    • Object-Oriented Python
    • Advanced Objects
    • Emulating Built-ins

    1 Answer

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

    Treehouse

  • About
  • Blog
  • Careers
  • Community
  • Stories
  • Shop
  • Contact
  • Gift Card

See Full Catalogue

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
  • Python Development
  • Data Analysis
  • UX Design

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
  • ...see more

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
  • ...see more

Explore

  • Plans
  • Affiliates
  • Perks
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
Terms & Conditions | Privacy

© 2025 Treehouse Island, Inc.