joshgachnang / diveintopython

A mirror of diveintopython.org.
157 stars 48 forks source link

info function error in #111

Open JDface opened 6 years ago

JDface commented 6 years ago

Hello:

I am getting following error when i call info function. error is throwing about invalid syntax for ( print "\n".join(["%s %s" % (method.ljust(spacing),)

I believe it has to do with "\n"

Any help is greatly appreciated.

thanks ERROR:-

File "", line 1, in from apihelper import info

File "E:\ProgramData\Anaconda3\Lib\diveintopython\apihelper.py", line 41 print "\n".join(["%s %s" % ^ SyntaxError: invalid syntax

RufusVS commented 6 years ago

Are you using python 2.7 or 3.x?

The fact that you are in a subdirectory of Anaconda3, I think it's python 3.

If you are using python 3, you need to have parentheses around your print argument:

print a,b # Python 2.7 print (a,b) # Python 3+