- #36
jedishrfu
Mentor
- 15,048
- 9,557
scottdave said:My first exposure to it was version 3.5, I think. I have come across code examples which were written for 2.x One thing I found is that the print statements work different in 2. and 3.
In 2.x, it is a statement. You would type
for example.Code:print "Hello, World"
In 3.x it is a function. The argument of the function must be enclosed in parenthesis:
Code:print("Hello, World")
Yes, I think the designers of Python changed from supporting print as a feature of the language to making it a function call instead as is done in many other languages like C/C++. (BASIC had a print statement that was a feature of the language).