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

New No-Code Track! 🚀 New videos dropping every week—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
  • Begana Choi
    PLUS
    Begana Choi
    Courses Plus Student 13,126 Points

    why do we need value=0 argument in D6 class?

    Posted December 3, 2020 2:34pm by Begana Choi
    Begana Choi
    Courses Plus Student 13,126 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Stephen Lorenz
    Stephen Lorenz
    3,271 Points

    What does the "or" do in self.value = value or random.rantint(1,sides)

    Posted November 22, 2020 9:40pm by Stephen Lorenz
    Stephen Lorenz
    3,271 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Jaron Trotter
    Jaron Trotter
    11,472 Points

    My workspace's console gives me the error "No such file or directory" every time.

    Posted October 25, 2020 11:35pm by Jaron Trotter
    Jaron Trotter
    11,472 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • spencer tintorri
    spencer tintorri
    6,184 Points

    Why do we include value in the D6 subclass?

    Posted August 7, 2020 11:28pm by spencer tintorri
    spencer tintorri
    6,184 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Aizah Sadiq
    Aizah Sadiq
    2,435 Points

    Why is this resulting in an error?

    Posted July 15, 2020 9:54pm by Aizah Sadiq
    Aizah Sadiq
    2,435 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    2 Answers

  • Joseph Michelini
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Joseph Michelini
    Python Development Techdegree Graduate 18,692 Points

    Where is the attribute "sides" stored?

    Posted July 14, 2020 7:22pm by Joseph Michelini
    .a{fill-rule:evenodd;}techdegree seal-36
    Joseph Michelini
    Python Development Techdegree Graduate 18,692 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Aizah Sadiq
    Aizah Sadiq
    2,435 Points

    What's wrong with the console?

    Posted July 13, 2020 1:34am by Aizah Sadiq
    Aizah Sadiq
    2,435 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    3 Answers

  • Anwar Rizalman
    seal-mask
    .a{fill-rule:evenodd;}techdegree seal-36
    Anwar Rizalman
    Python Development Techdegree Graduate 33,620 Points

    Why not use the try block when checking for errors?

    Posted July 12, 2020 5:47am by Anwar Rizalman
    .a{fill-rule:evenodd;}techdegree seal-36
    Anwar Rizalman
    Python Development Techdegree Graduate 33,620 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Nicholas Abate
    Nicholas Abate
    1,643 Points

    Super() Arguments

    Posted May 31, 2020 5:25pm by Nicholas Abate
    Nicholas Abate
    1,643 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Katherina Kallis
    Katherina Kallis
    3,385 Points

    I don't understand why we need a value argument if the number needs to be random.

    Posted May 29, 2020 1:12pm by Katherina Kallis
    Katherina Kallis
    3,385 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Alan T.
    Alan T.
    4,784 Points

    cd yatzy/ isn't working

    Posted April 2, 2020 3:52am by Alan T.
    Alan T.
    4,784 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Bharat B
    Bharat B
    535 Points

    D6 class or instance?

    Posted March 9, 2020 3:00am by Bharat B
    Bharat B
    535 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    2 Answers

  • Haifa Bassam
    Haifa Bassam
    10,333 Points

    AttributeError

    Posted February 5, 2020 3:50pm by Haifa Bassam
    Haifa Bassam
    10,333 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    2 Answers

  • daniel steinberg
    daniel steinberg
    14,651 Points

    [SOLVED] self.value = value or random.randint(1, sides)

    Posted October 9, 2019 6:45pm by daniel steinberg
    daniel steinberg
    14,651 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    0 Answers

  • Jay Reyes
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    Jay Reyes
    Python Web Development Techdegree Student 15,937 Points

    The "or" statement and it's preference

    Posted December 23, 2018 3:00am by Jay Reyes
    .a{fill-rule:evenodd;}techdegree
    Jay Reyes
    Python Web Development Techdegree Student 15,937 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Pitrov Secondary
    Pitrov Secondary
    5,121 Points

    05:02 Why does he do dice.D6() and not only D6() or Die.D6?

    Posted November 21, 2018 3:42am by Pitrov Secondary
    Pitrov Secondary
    5,121 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • nakalkucing
    nakalkucing
    12,964 Points

    When trying to run D6 I keep on getting: AttributeError: type object 'D6' has no attribute 'value' Help please!

    Posted May 15, 2018 6:56pm by nakalkucing
    nakalkucing
    12,964 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    3 Answers

  • Simon Amz
    Simon Amz
    4,606 Points

    define attribute as value = value

    Posted January 16, 2018 11:28am by Simon Amz
    Simon Amz
    4,606 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    3 Answers

  • Ashley Keeling
    Ashley Keeling
    11,476 Points

    why is the class called 'die' ?

    Posted January 13, 2018 6:47pm by Ashley Keeling
    Ashley Keeling
    11,476 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Alexa Kapor-Mater
    Alexa Kapor-Mater
    4,674 Points

    Why is self.sides not specified as an attribute in Die?

    Posted November 3, 2017 1:00pm by Alexa Kapor-Mater
    Alexa Kapor-Mater
    4,674 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Stefano Nebiolo
    Stefano Nebiolo
    1,991 Points

    value=value

    Posted October 18, 2017 10:39am by Stefano Nebiolo
    Stefano Nebiolo
    1,991 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Suraj Shah
    Suraj Shah
    1,055 Points

    TypeError: __init__

    Posted August 12, 2017 3:59pm by Suraj Shah
    Suraj Shah
    1,055 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Henry Lin
    Henry Lin
    11,636 Points

    why is self.value = value or random.randint(1,sides) instead of self.value = random.randint(1,sides) directly?

    Posted August 4, 2017 7:03pm by Henry Lin
    Henry Lin
    11,636 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    2 Answers

  • hamsternation
    hamsternation
    26,616 Points

    Or statement execution

    Posted August 1, 2017 5:21pm by hamsternation
    hamsternation
    26,616 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    1 Answer

  • Frank Campos
    Frank Campos
    4,175 Points

    I dont understand, how can I canculate the sides and value in class Die?

    Posted June 23, 2017 9:07pm by Frank Campos
    Frank Campos
    4,175 Points
    • Python
    • Object-Oriented Python
    • Dice Roller
    • Project Breakdown

    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.