Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics (2015) Letter Game App Letter Game Refinement

using set while comparing looks to me like it would skew the result

# len("coconut") = 7 len(set("coconut")) = 5
    while len(bad_guesses) < 7 and len(good_guesses) != len(set(secret_word)):
Peter Lawless
Peter Lawless
24,404 Points

Can you explain what you mean a little more?

Can you please explain your question in more detail?

this code checks the lengths of two lists, bad_guesses and good_guesses. Looking up set I got the impression that it eliminates duplicates. Which, when I compared the len of coconut to len set coconut, it does indeed to that. So how could , ... wait...I just realized that if o is guessed it only goes in good guesses once, so if we do len secret_word it will have the duplicate letters so they will likely never match. Got it, Thanks for your help:D