That is correct. From my understanding, print will query each objects
_repr_ which it stores in a tuple and then prints that tuple out.
The reason why the single value is not a tuple, is that you cannot create a
tuple with one value.
ie variableA = (), or variableA = (1) should both fail
if you want to create a tuple with only one value you have to write
variableA = (1,)
On Friday, 22 September 2017 13:27:19 UTC+10, jettam wrote:
>
> I have a question about adding a comma to the end of a these print
> statements. In the first example ( print (Blah)) with out the comma,
> it prints the string? and in the second example where I added the comma (
> print (Blah,) ) It turns it into a tuple? Is my observation correct
> here?
>
> Blah = "the comma changes it into, a tuple!?"
> print (Blah)
> # result: the comma changes it into, a tuple!?
>
>
> Blah = "the comma changes it into, a tuple!?"
> print (Blah,)
> # result: ('the comma changes it into, a tuple!?',)
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/2a74e97c-21f1-4fed-a2fc-42b2d54d06fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.