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 Introduction

Siddharth Pande
Siddharth Pande
9,046 Points

hey @kennethlove there is a bug in the code that you've written. what if a fruit name has a letter that is in two.....

a fruit name has a letter that is in two positions eg "apple" or "watermelon". Your code starts to behave awkwardly. Kindly let us know how to solve this issue.

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! First, Kenneth is no longer with Treehouse and many of us miss him terribly. That being said, the first place you should look with any of the videos are the "Teacher's Notes". They aren't always just documentation links. Sometimes, they are easter eggs (surprises)!

Take a look at the Teacher's Notes for this one:

Did you notice? There's a tricky condition (on purpose) in the final version of our code from this video. Words that have repeated characters won't be marked as correct once they're all correctly guessed due to our len() comparisons. See if you can find a way to fix that yourself! We'll write a version without that bug in the next video.

Hope this helps! :sparkles:

Siddharth Pande
Siddharth Pande
9,046 Points

Hi Jennifer Nordell thanks for your quick response. I am glad to tell you that I found a way to bypass the bug by adding a for loop i.e. for letter in secret_word: if letter == guess: good_guess.append(guess)