I'm running Python 3.6 and have trouble getting started

125 views
Skip to first unread message

Raghu Raj Rai

unread,
Nov 7, 2017, 6:27:49 AM11/7/17
to Python GCU Forum
I'm using Anaconda rather than the python shell. 
I tried running the first hello.py file from the downloaded folder but it gave me a syntax error probably because it's Python 2 code.

Switching to Python 2 doesn't seem like a good option. 
Should I continue ?

Huan Wang

unread,
Nov 8, 2017, 2:24:11 AM11/8/17
to Python GCU Forum
Hi Raghu, 

The simplest way is adding parentheses behind the print, e.g. print("Hello World.").
Python 3 changed the print into a function, so the syntax is different from Python 2.

Best wishes,
Huan
.

在 2017年11月7日星期二 UTC+2下午1:27:49,Raghu Raj Rai写道:
Reply all
Reply to author
Forward
0 new messages