(Mar-11-2018, 03:45 AM)volcano Wrote: I'm using python 3.4. What is print in Python 3.4 ? statement or function ?
In all python 3 versions is print a function.
(Mar-10-2018, 04:27 PM)volcano Wrote: why it prints ('Hello',3)?
Because you use Python 2.
# Python 2.7
>>> print("Hello", 3)
('Hello', 3)
# Python 3.6
>>> print('hello', 3)
hello 3
You should use Python 3.6.
Help on print function.
>>> help(print)
Help on built-in function print in module builtins:
print(...)
print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False)
Prints the values to a stream, or to sys.stdout by default.
Optional keyword arguments:
file: a file-like object (stream); defaults to the current sys.stdout.
sep: string inserted between values, default a space.
end: string appended after the last value, default a newline.
flush: whether to forcibly flush the stream.
# Example want to keep comma
>>> print('hello', 3, sep=',')
hello,3