0
Whats the difference with "print" or whitout, only the string.
1. >>>Print 'hello world' Or 2. >>> 'hello world'
2 Answers
+ 1
Thank so much.
0
In console >>> will print the representation format of a value repr(value), where print function will print the string representation of a value str(value).
>>>x
output is same than:
>>>print(repr(x))
With builtin datatypes repr and str does not have much differences, but with strings, repr will give the string with extra quotes.
repr("Hello") -> "\'Hello\'"
str("Hello") -> "Hello"
repr(25) -> "25"
str(25) -> "25"
Also >>> will ignore None types.
>>> None
(no output)
>>> print(None)
None