Skip to main content

NOTICE: On Friday Nov 6, Workspaces will be temporarily unavailable for maintenance.

🚀 In our NEW AI Bootcamp you'll build a working app in 28 days, no experience required. Free to all subscription levels.

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

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

  • Treehouse Logo
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
    • All Courses
    • Tracks
    • AI Bootcamp
    • College Credit
    • Techdegree Bootcamps
    • Front End Development
    • Full Stack JavaScript
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
    • Explore
    • Career Toolbox
    • Free Treehouse Near Me
    • Affiliates
    • Blog
    • Support
    • About
    • Learn
    • Beginner's Guide to Coding
    • Data Analysis with SQL & Python
    • Front-End Web Development
    • Python Programming Basics
    • Techdegree Bootcamp Overview
    • UX Design Fundamentals
    • AI Tools for Beginners
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks AI Bootcamp College Credit
  • Techdegree Bootcamps Front End Web Development Full Stack JavaScript
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox Free Treehouse Near Me Affiliates Blog Support About
    Learn Beginner's Guide to Coding Data Analysis with SQL & Python Front-End Web Development Python Programming Basics Techdegree Bootcamp Overview UX Design Fundamentals AI Tools for Beginners
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
Loading banner... Start your free trial at Treehouse
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • 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
      • • Vibe Coding
  • 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,617 Points

    Or statement execution

    Posted August 1, 2017 5:21pm by hamsternation
    hamsternation
    26,617 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.

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
SEE ALL

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
SEE ALL

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
SEE ALL

About Us

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

Explore

  • Plans
  • Affiliates
  • Perks
  • Shop
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses

Treehouse is an online technology education platform founded in 2011. Treehouse offers more than 700 self-paced, video-based courses in web development, programming, data analysis, design, and AI, plus two project-based bootcamp programs in Front End Web Development and Full Stack JavaScript. Individual Treehouse plans start at $25 per month and include a 7-day free trial. Treehouse serves individual learners, businesses, schools, and public libraries. Cardholders at participating U.S. public libraries can use Treehouse for free. Select Treehouse courses, offered with University Pathways International, are recommended for college credit by ACE and NCCRS. Treehouse learners earn digital certificates for completed Tracks.

Terms & Conditions · Privacy · © 2026 Treehouse Island, Inc.
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
  • Discord