Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
As stated in the title, I found that (1) and (1,) are different. But what's the difference of them?
(1)
(1,)
In[39]: (1) == (1,) Out[39]: False
Try this to convince yourself:
>>> type((1)) <type 'int'> >>> type((1,)) <type 'tuple'>
The following identity checks may provide you with further insight into the differences:
>>> (1) is 1 True >>> (1,) is 1 False
Add a comment
The comma makes it a tuple. (1) is just the same as 1 wrapped in delimiters.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.