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 (Retired) Ins & Outs Basic I/O

syntax error near unexpected token

when ever i am trying to run something in console i am getting this error -su: syntax error near unexpected token

help(str) -su: syntax error near unexpected token help' print("hi from python") -su: syntax error near unexpected token"hi from python"'

similarly i am new to python please help me

1 Answer


My guess is that you are running those commands directly in the console. Try this: 1) In console, type "python" (without qoutes), and enter 2) Now you should be inside python shell, with >>> as prompt. 3) Now you can do "help(str)" or "help(print)"

This is because those commands are part of python, unless you are inside python shell, you can not run them directly.

Thank you it worked