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

Console error when input function is specified.

When I typed in the "input('How are you today?')" in the console (without the ""), the console returned a SyntaxError: invalid syntax with a:

 File "<stdin>@, line 1
      input('How are you today?')re you today?
                                  ^

SyntaxError: invalid syntax

Screenshot: https://gyazo.com/80db3702d208e73e119355d8750f9260

1 Answer

Steven Parker
Steven Parker
243,656 Points

Very strange issue! But I was unable to replicate it:

treehouse:~/workspace$ python
Python 3.6.4 (default, Jun 15 2018, 21:48:04)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> input('How are you today?')
How are you today?great!
'great!'

All I can think to suggest is restart your browser and/or reboot your computer.

I have no idea how it happened, but when I cleared the console and re-did the expression, it worked fine, which is interesting...

Thanks for the help though!