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

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

# How does entering the letter 'q', quit this program?

Having noticed that 'q' did not quit my game I have been looking for the code which I may have missed but I have been unsuccessful in doing so. I would welcome any pointers for any oversight which I may have made. Much appreciated.

```import random
# make a list of words
words= ['apple', 'bananna', 'orange','coconut','strawberry','lime'
, 'grapefruit','lemon','kumquat','bluberry','melon'
]
while True:
start = input("press enter/ return to start or enter q to quit")
# pick a random word
secret_word = random.choice(words)
good_guess = []

while len(bad_guess) < 7 and len(good_guess) != len(list(secret_word)):

# draw spaces
for letter in secret_word:
if letter in good_guess:
print(letter, end='')
else:
print('_', end='')

print('')
print('')
# take guess
guess = input("Guess a letter: ").lower()
if len(guess) != 1:
print("You can only guess a single letter !")
continue
elif guess in bad_guess or guess in good_guess:
continue
elif not guess.isalpha():
print("You can only get letters")
continue

if guess in secret_word:
good_guess.append(guess)
if len(good_guess) == len(list(secret_word)):
print("You win! The word was {}".format(secret_word))
break
else:
else:
print("You didn't get it! My secret word was {}".format(secret_word))
# draw guessed letters and strike
# print out win/lose
```

Btw, thank you for the 'back ticks' tip. you have made my life a less challenging in posting questions. Also this is the code video tutorial

for formatting, paste it between three backticks, specifying python for the language like so.

I've used single quotes, but you'll want to use the backtick to the left of the 1 key

'''python

'''

Better example of code formatting (I'm using backticks in this example):

```python

```

Output when you post the code:

```<your code goes here>
```

Looks like you're not checking if the user entered 'q' to quit. You collect some input, stored in the variable start but then do nothing with it. If you add an if statement and break after the input, it should allow the user to quit the game by entering q

```while True: