0

Maybe this question sounds stupid, but is there a function which e.g. takes the inputs a and 5 and outputs a list [a,a,a,a,a] in GAP-system, similar to numpy.full() in python?

I have searched extensively in the GAP manual, but to no avail. I could write something like

Full := function(elem, length)
  local l, k;
  l := [];
  for k in [1..length] do
    l[k] := elem;
  od;
end;

but isn't there a built-in function for this??? Any help will be appreciated!

Ooooscar
  • 1
  • 1
  • You can use [ListWithIdenticalEntries](https://docs.gap-system.org/doc/ref/chap21.html#X80FDB1457FF582E7) but, depending on which objects you use, beware of [this](https://docs.gap-system.org/doc/ref/chap21.html#X7DD65BEA7EDB0CD7) explaining what does *identical* mean. – Olexandr Konovalov Jul 19 '23 at 11:49
  • Thanks so much! I don't know why I didn't find this method. haha :) – Ooooscar Jul 19 '23 at 13:46

0 Answers0