✨ 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
    • Dice Roller
    • Project Breakdown
    • Close
  • Begana Choi
    PLUS
    Begana Choi
    Courses Plus Student 13,126 Points

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

    Posted on Dec 3, 2020 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 on Nov 22, 2020 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 on Oct 25, 2020 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 on Aug 7, 2020 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 on Jul 15, 2020 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 on Jul 14, 2020 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 on Jul 13, 2020 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 on Jul 12, 2020 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 on May 31, 2020 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 on May 29, 2020 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 on Apr 2, 2020 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 on Mar 9, 2020 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 on Feb 5, 2020 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 on Oct 9, 2019 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 on Dec 23, 2018 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 on Nov 21, 2018 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 on May 15, 2018 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 on Jan 16, 2018 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 on Jan 13, 2018 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 on Nov 3, 2017 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 on Oct 18, 2017 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 on Aug 12, 2017 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 on Aug 4, 2017 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 on Aug 1, 2017 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 on Jun 23, 2017 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.