🤑 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

  • 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
    • Community Projects
    • Live Sessions
    • 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
  • Community Projects Live Sessions 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
  • JASON LEE
    JASON LEE
    17,352 Points

    Law of Demeter principle at @3:05 ?

    Posted December 23, 2023 9:32pm 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 October 27, 2023 12:35am 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 May 17, 2021 7:33pm 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 October 16, 2020 7:09am 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 September 29, 2020 9:25am 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 September 29, 2020 9:18am 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 September 7, 2020 6:23am 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 August 4, 2020 8:02pm 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 August 4, 2020 7:31pm 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 May 24, 2020 7:06am 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 May 5, 2020 10:20pm 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 March 28, 2020 10:34pm 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 November 4, 2019 10:44am 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 October 17, 2019 9:34pm 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 October 8, 2019 5:11pm 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 September 27, 2019 11:07am 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 September 14, 2019 2:17am 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 July 5, 2019 8:10pm 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 November 24, 2018 6:31pm 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 November 19, 2018 3:55am 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 November 18, 2018 11:42am 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 September 7, 2018 8:02am 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 September 1, 2018 7:57pm 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 August 12, 2018 6:55pm 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 July 19, 2018 10:12pm 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 June 16, 2018 2:10pm 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 May 30, 2018 10:00am 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 September 26, 2017 8:47am 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 June 27, 2017 8:52pm 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.