Home > other >  To help explain the
To help explain the

Time:11-10

After the statement x=(3) perform the value of x is () () (3)

Statement x=(3) the value of x for (a) (3)

CodePudding user response:

1. The first 2:
> X=(3)
> X
3
> Type (x)

To the right of the bracket is actually the arithmetic of parentheses, equivalent to x=(3 + 1-1), so the x type is int

2,
> X=(3)
> X
(3)
> Type (x)
> X [0]
3
Here, because of the comma, the right of the bracket into a tuple the tuple type, only one of the elements of a tuple, so [0]=3 x
  • Related