ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 03 Feb 2014 16:44:42 +0100converting a set into a list?https://ask.sagemath.org/question/7548/converting-a-set-into-a-list/how to convert a set into a list in sage?Sun, 02 Feb 2014 14:29:49 +0100https://ask.sagemath.org/question/7548/converting-a-set-into-a-list/Comment by kcrisman for <p>how to convert a set into a list in sage?</p>
https://ask.sagemath.org/question/7548/converting-a-set-into-a-list/?comment=16347#post-id-16347I would have thought the current answer works, so please edit your post to a very explicit example. By the nature of sets, their is only one of each element! Or do you mean multisets, or just want partitions? Thanks!Mon, 03 Feb 2014 10:49:06 +0100https://ask.sagemath.org/question/7548/converting-a-set-into-a-list/?comment=16347#post-id-16347Answer by ndomes for <p>how to convert a set into a list in sage?</p>
https://ask.sagemath.org/question/7548/converting-a-set-into-a-list/?answer=15999#post-id-15999
S = set([1,1,2,2,2,3,4,5])
L = list(S)
print L;
type(S); type(L)Sun, 02 Feb 2014 15:01:57 +0100https://ask.sagemath.org/question/7548/converting-a-set-into-a-list/?answer=15999#post-id-15999Comment by Volker Braun for <pre><code>S = set([1,1,2,2,2,3,4,5])
L = list(S)
print L;
type(S); type(L)
</code></pre>
https://ask.sagemath.org/question/7548/converting-a-set-into-a-list/?comment=16341#post-id-16341by definition, a set has no duplicate entries.Mon, 03 Feb 2014 16:44:42 +0100https://ask.sagemath.org/question/7548/converting-a-set-into-a-list/?comment=16341#post-id-16341Comment by REKHA BISWAL for <pre><code>S = set([1,1,2,2,2,3,4,5])
L = list(S)
print L;
type(S); type(L)
</code></pre>
https://ask.sagemath.org/question/7548/converting-a-set-into-a-list/?comment=16354#post-id-16354@ndomes But it keeps only one 1 in the list.But i want to write set([1,1,2,2,2,3,4,5]) in partition form.That means i want output to be the list [5,4,3,2,2,2,1,1].Could you please tell me how to do it?Mon, 03 Feb 2014 00:43:47 +0100https://ask.sagemath.org/question/7548/converting-a-set-into-a-list/?comment=16354#post-id-16354