🤑 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
    • 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
  • Hannah Dickey
    Hannah Dickey
    5,986 Points

    No module named 'Monster'?

    Posted February 27, 2017 6:37pm by Hannah Dickey
    Hannah Dickey
    5,986 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    2 Answers

  • Jeffrey Covington
    Jeffrey Covington
    7,246 Points

    How do you go to the next line with proper indentation @ 1:47

    Posted December 14, 2016 6:10pm by Jeffrey Covington
    Jeffrey Covington
    7,246 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    1 Answer

  • Evan Waterfield
    Evan Waterfield
    3,240 Points

    Indention error on line 23 but I don't understand why it's an error

    Posted September 6, 2016 10:18pm by Evan Waterfield
    Evan Waterfield
    3,240 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    1 Answer

  • katecsak
    katecsak
    1,212 Points

    In the define __str__ method, why exactly do you put in there self. __class.__name__ and THEN the self.hit_points?.....

    Posted June 28, 2016 6:45pm by katecsak
    katecsak
    1,212 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    1 Answer

  • Nelson Chuang
    Nelson Chuang
    1,221 Points

    why does he not explain what __class__.__name__ is? I don't get it. there's 4 placeholders but 5 arguments

    Posted June 21, 2016 3:16am by Nelson Chuang
    Nelson Chuang
    1,221 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    1 Answer

  • Nursultan Bolatbayev
    Nursultan Bolatbayev
    16,774 Points

    Random choice

    Posted May 16, 2016 12:37pm by Nursultan Bolatbayev
    Nursultan Bolatbayev
    16,774 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    1 Answer

  • Iskander Ismagilov
    Iskander Ismagilov
    13,298 Points

    How can I print instance name?

    Posted February 13, 2016 3:57pm by Iskander Ismagilov
    Iskander Ismagilov
    13,298 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    2 Answers

  • Lior Dolinski
    Lior Dolinski
    3,905 Points

    __str__ simply won't work when i print my instance

    Posted February 8, 2016 4:53pm by Lior Dolinski
    Lior Dolinski
    3,905 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    2 Answers

  • saro lin
    PLUS
    saro lin
    Courses Plus Student 531 Points

    pass ??

    Posted January 30, 2016 2:18pm by saro lin
    saro lin
    Courses Plus Student 531 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    2 Answers

  • missingn
    missingn
    3,479 Points

    [SOLVED] I'm getting this error: AttributeError: 'Dragon' object has no attribute '_Monster__class_' ...not sure why.

    Posted September 22, 2015 10:16pm by missingn
    missingn
    3,479 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    2 Answers

  • Christian Kuylen
    Christian Kuylen
    3,176 Points

    Need help manipulating random inputs for my monsters in the game we are building

    Posted September 17, 2015 8:47am by Christian Kuylen
    Christian Kuylen
    3,176 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    1 Answer

  • peter keves
    peter keves
    6,854 Points

    I'm not sure if i missed something in the last video but why did we use .title() in color property

    Posted August 29, 2015 9:56am by peter keves
    peter keves
    6,854 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    2 Answers

  • Hunter Kiely
    Hunter Kiely
    2,768 Points

    Help understanding a specific argument given to the format function

    Posted June 15, 2015 8:58pm by Hunter Kiely
    Hunter Kiely
    2,768 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    1 Answer

  • Zachary Smith
    Zachary Smith
    1,592 Points

    Python "magic methods" clarification

    Posted May 27, 2015 10:26pm by Zachary Smith
    Zachary Smith
    1,592 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    1 Answer

  • Tristan Gaebler
    Tristan Gaebler
    6,204 Points

    Dragon is not defined

    Posted April 21, 2015 11:44pm by Tristan Gaebler
    Tristan Gaebler
    6,204 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    1 Answer

  • Jean Beltre
    Jean Beltre
    1,181 Points

    Do you always need to specify from library import class?

    Posted February 13, 2015 12:59am by Jean Beltre
    Jean Beltre
    1,181 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    1 Answer

  • Vamsi Pavan Mahesh Gunturu
    Vamsi Pavan Mahesh Gunturu
    4,541 Points

    I am getting name error

    Posted January 14, 2015 11:20am by Vamsi Pavan Mahesh Gunturu
    Vamsi Pavan Mahesh Gunturu
    4,541 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    1 Answer

  • Joel Thompson
    Joel Thompson
    1,729 Points

    For some reason when using the __str__ print method it prints the HP and XP as tuples.

    Posted January 1, 2015 10:21pm by Joel Thompson
    Joel Thompson
    1,729 Points
    • Python
    • Object-Oriented Python (retired)
    • Inheritance
    • __str__

    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.