Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

varx = var('x y') defines a tuple of two variables, which can be accessed as varx[0] and varx[1], which have names x and y respectively.

list(varl) is undefined as its requests conversion of a variable varl into a list. It's not the same as creating a list composed of a single variable, which would be [varl] as you noticed. And in general, list(obj) is not the same as [obj] where obj is any object.

varx = var('x y') defines a tuple of two variables, which can be accessed as varx[0] and varx[1], which have names x and y respectively.

list(varl) is undefined as its requests conversion of a variable varl into a list. It's not the same as creating a list composed of a single variable, which would be [varl] as you noticed. And in general, list(obj) is not the same as [obj] where obj is any object.

list(varx) converts the tuple varx into a list (still composed of two variables), which enables further concatenations with other lists, like list(varx)+[varl].