## 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.

# My code solved the issue but... what about quality?

It seems that the code I wrote works just fine (it even solve the repeated letter issue) but after seeing the professor solution it kept me wondering if I just made a mess of code. I mean the solution was very different and didn't seem as well planned so I begin to wonder about code quality. How can I know if my code was good quality? Are there any industry rules to follow?

```import random

print("\n Our supreme AI is selecting a word from the list you choose...\n...LISTO! Let's start!")
secret_word = random.choice(wordlist)
game_status = []
for letter in secret_word:
game_status.append("_")
try_num = 3
while True:

print("\n ----------------------------------------------\n")
display = " ".join(game_status)
print(display)
if try_num >=1:
guess = input("\nYou have only {} attemps left. Shoot: ".format(try_num)).lower()
while len(guess)!=1:
if len(guess)>1:
guess = input("\nHey hey hey! You cheater. Only one letter allowed \nShoot: ")
else:
guess = input("\nYou do know just pressing enter won't work right?. \nShoot: ")
guess = input("\nRepeating a letter won't change the result. \nShoot: ")
if guess in secret_word:
place = 0
for letter in secret_word:
if letter == guess:
game_status[place]=guess
place += 1
print("\nThat's a hit!... we do have the letter: {} ".format(guess))
else:
try_num -= 1
print("\nNoup...miss.")
else:
print("\nNice try but noup... \nThe word was: " + secret_word)
break

if "_" not in game_status:

print("\nCongrats! You completed the word. \nLa palabra era:" + secret_word)
break
```