(Oct-19-2016, 04:11 PM)sparkz_alot Wrote:(Oct-19-2016, 03:53 PM)buran Wrote:(Oct-19-2016, 03:36 PM)sparkz_alot Wrote: Yes, I understand, I was pointing out the the example "print(())" is actually not a tuple
the output, i.e.
IS EXACTLY the string representation of the tuple class (empty tuple instance to be precise)
Output:()
Logically, one would think so, but Python does not. As shown in my example, Python see it as class 'NoneType', not class 'tuple'
You DO make difference between the type of the argument you pass to the print function and the type of the return value of the function, right? If you don't make that difference, then I don't see how I can explain it better
Output:>>> type(print('something'))
something
<class 'NoneType'>
You would not say that 'something' is of NoneType, right?