I have a list l = [1, 2, 3]
and I want l[2->infinity] == 3
. It would essentially look like [1, 2, 3, 3, 3, 3, ...]
. I tried:
[1, 2, *3]
or
[1, 2, 3, ...]
Is there anyway to add a "default element" for a range of indices?
Clarification
I don't want to repeat the element n
times because I can't index outside the length of the list. I want to actually have a value for all indexes from 2->infinity
. Some sort of default value for that index range.