[Tutor] syntax error with raw input
wescpy at gmail.com
Wed Nov 12 22:31:51 CET 2014
Slightly hijacking this thread a bit, specifically Alan's reply, if anyone
is averse to installing multiple versions of Python on their computers, you
can always access a Python interpreter from a browser window.
Here are a collection I've put together. Most are Python 2, but the top
pair also support Python 3:
- http://ideone.com (2.x & 3.x)
- http://colabv6.dan.co.jp/lleval.html (2.x & 3.x)
- http://skulpt.org (pure JS implementation; allows turtle)
- http://shell.appspot.com (Google App Engine + libraries)
On Wed, Nov 12, 2014 at 9:11 AM, Alan Gauld <alan.gauld at btinternet.com>
> On 12/11/14 11:08, Vaibhav Banait wrote:
>> I am new to python. I learnt (!) using raw_input a day back. Attempt to
>> use has resulted in error. I am not able to spot a problem in syntax. I
>> am using python 3.4.2. Kindly help
> Looks like you are reading a v2 book/tutorial but using v3.
> In v3 several key changes were made to Python including the renaming of
> raw_input() to input().
> The other big change was making print a function so you now *must* put
> parentheses around anything you want to print.
> print 'hello' # Python v2
> print('hello') # python v3
> There are numerous other small changes so it would be better for you to
> either find a v3 tutorial (you could try mine! :-) or install Python v2.7
> while you are learning.
> Alan G
> Author of the Learn to Program web site
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"A computer never does what you want... only what you tell it."
+wesley chun <http://google.com/+WesleyChun> : wescpy at gmail : @wescpy
Python training & consulting : http://CyberwebConsulting.com
"Core Python" books : http://CorePython.com
Python blog: http://wescpy.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor