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 trialjohn larson
16,594 Pointsusing 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)):
Alexander Davison
65,469 PointsCan you please explain your question in more detail?
john larson
16,594 Pointsthis 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
Peter Lawless
24,404 PointsPeter Lawless
24,404 PointsCan you explain what you mean a little more?