First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To circumvent this problem the frozenset (which can't be modified after creation) was invented:

sage: a.add(frozenset(b))
sage: a
{1, frozenset({2})}
click to hide/show revision 2
No.2 Revision

To circumvent this problem the frozenset (which can't be modified after creation) was invented:

sage: a.add(frozenset(b))
sage: a
{1, frozenset({2})}

Another alternative is to use Sage's Set:

sage: a=Set([1])
sage: b=Set([2])
sage: a.union(Set([b]))
{1, {2}}