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.

Start your free trial

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

Syntax Error on Letter Game

File "letter_game.py", line 31 print(letter, end='') ^ SyntaxError: invalid syntax

I am copying the game from the video into Notepad++ and this is what I get when I try to run the program. The syntax error is pointing at the end=' '. Did I do something wrong?

2 Answers

Afrid Mondal
Afrid Mondal
6,255 Points

Hi Christopher, at the end of 'end' key word there must be single or double cote notation. So there will be either ..

 print(letter, end=" ")


 print(letter, end=' ')

[changed to answer by mod]

Vladislav Roscovan
Vladislav Roscovan
17,565 Points

Are you sure that you are using python 3.x? This syntax is not available in 2.x python because print is a statement.

Try this: print letter,

It will use space instead of new line ending.