Your print statement in the tutorial is misisng parethesis
I am learning Python 3.5. I'm following your examples in section 3 "An informal introduction to Python" tutorial. The "print" statement is shown without parenthesis in the tutorial and in Python 3.5 it only works with parenthesis. In fact, if I try to type it as you have it shown, I get an error and am being told to add parenthesis. When I add parenthesis it works. Regards, Perry Rothenbaum ON Semiconductor Field Applications System Engineering (Continental Automotive) 1515 Woodfield Road, Suite 745 Schaumburg, IL 60173 Cell 312 805 9456 perry.rothenbaum@onsemi.com<mailto:perry.rothenbaum@onsemi.com>
On 08/05/2016 03:37 AM, Perry Rothenbaum wrote:
I am learning Python 3.5. I’m following your examples in section 3 “An informal introduction to Python” tutorial. The “print” statement is shown without parenthesis in the tutorial and in Python 3.5 it only works with parenthesis. In fact, if I try to type it as you have it shown, I get an error and am being told to add parenthesis. When I add parenthesis it works.
Hi Perry, please take care which version of the tutorial you're reading: there are separate versions for Python 2 (where "print" is a statement that doesn't require parens) and Python 3 (where it does, as you noticed). The links are https://docs.python.org/2/tutorial/ and https://docs.python.org/3/tutorial/ cheers, Georg
participants (2)
-
Georg Brandl
-
Perry Rothenbaum