Vyacheslav Maslov wrote:
> So, the main question is why using syntax like [X] python constuct list
> with
> one item, but when i try to construct tuple with one item using similar
> syntax (X) python do nothing?
Because `(` and `)` are used in expressions to bracket sub-expressions.
a = (4 + 3)
Vyacheslav Maslov wrote:
> So, the main question is why using syntax like [X] python constuct list with
> one item, but when i try to construct tuple with one item using similar
> syntax (X) python do nothing?
Because what determines that you actually have a tuple is the comma, not
the parenthesi
Hi, all!
I found out different behavior of python interpeter related to tuples and
lists with one item only.
I have simple example
print type(())
it's ok, we have just constructed empty tuple
print type((4))
but when i add exactly one item to my tuple i get atomaric int instead of
tuple!!