
Hi, I've just installed Python v3.1.2 onto Windows Vista. I started IDLE and typed help() which suggested I look at http://docs.python.org/tutorial/ Section 2.1.2. Interactive Mode suggested the following code: the_world_is_flat = 1if the_world_is_flat: print "Be careful not to fall off!" The line print "Be careful not to fall off!" generates SyntaxError: invalid syntax The Python v3.1.2 documentation on Windows which was installed as a Windows help file gives a slightly different Section 2.1.2. Interactive Mode suggestion: the_world_is_flat = 1if the_world_is_flat: print ("Be careful not to fall off!") This code works. The online documentation needs to change to show working code (or if appropriate indicate that the code is version specific). -- Regards, *Ian Sweeney* Head of IT * ------------------------------ * LLJ Property LLC PO Box 107729 Abu Dhabi UAE Tel: +44 7941 045102 Email: ian.sweeney@lljproperty.com* *www.lljproperty.com DISCLAIMER: The information contained in this mail is for the intended addressee only, if you have received this mail by mistake, please forward it to admin@lljproperty.com. Any opinions expressed, implied or presented are solely those of the author and do not necessarily represent those of LLJ Property LLC.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 04.11.2010 18:06, schrieb Ian Sweeney:
Hi,
I've just installed Python v3.1.2 onto Windows Vista.
I started IDLE and typed help() which suggested I look at http://docs.python.org/tutorial/
Section 2.1.2. Interactive Mode suggested the following code:
the_world_is_flat = 1 if the_world_is_flat: print "Be careful not to fall off!"
The line print "Be careful not to fall off!" generates SyntaxError: invalid syntax
The Python v3.1.2 documentation on Windows which was installed as a Windows help file gives a slightly different Section 2.1.2. Interactive Mode suggestion:
the_world_is_flat = 1 if the_world_is_flat: print ("Be careful not to fall off!")
This code works. The online documentation needs to change to show working code (or if appropriate indicate that the code is version specific).
That's true. In fact, the whole page identifies itself as the "Python v2.7 documentation"; and there is also a separate set for Python 3 at http://docs.python.org/py3k. regards, Georg -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iEUEARECAAYFAkzTs7kACgkQN9GcIYhpnLA/CwCeK2pwEZhKE9RhAaa4CjltqhgE HR8AlRAHuBu/4o+H07MFAYvHRdKFfIs= =Gw5n -----END PGP SIGNATURE-----
participants (2)
-
Georg Brandl
-
Ian Sweeney