I looked at similar questions but I didn't find this topic anywhere.
I want to know what does the tuple (1,) mean in Python?
I looked at similar questions but I didn't find this topic anywhere.
I want to know what does the tuple (1,) mean in Python?
From https://wiki.python.org/moin/TupleSyntax
One Element Tuples
One-element tuples look like:
1,The essential element here is the trailing comma. As for any expression, parentheses are optional, so you may also write one-element tuples like
(1,)but it is the comma, not the parentheses, that define the tuple.