[GAP Forum] counting elements

Robert Morse rm43 at evansville.edu
Fri May 14 12:06:06 BST 2010


The Length and Collected commands are what you are looking for.

gap> list:="abbccc";;
gap> Length(list);
6
gap> Collected(list);
[ [ 'a', 1 ], [ 'b', 2 ], [ 'c', 3 ] ]


Robert F. Morse



On Fri, May 14, 2010 at 4:47 AM, Jan Schneider <jansch2 at gmx.de> wrote:
> Hi there,
> I'm just wondering, whether you all can tell me how to count the objects of a list. If I define for example a list:="abbccc", how do I manage to let GAP count the letters?
> Hope to hear from you soon.
>
> Thanks
> Stefan
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
>
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum
>



More information about the Forum mailing list