
-----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-----