Concatenation of array and range

torhu torhu at yahoo.com
Sun Jan 26 22:23:23 UTC 2025


On Sunday, 19 January 2025 at 18:57:51 UTC, Samuel Redding wrote:
> Hello there,
>
> is it possible to concat an array and a range? In Python one 
> would have
> """
> list1 = [1, 2, 3]
> list1 += array.array('L', range(a, b))
> """
>

For the record, you can extend a list using a range object in 
Python:

     list1.extend(range(a, b))

or if you just want to iterate over them in order:

     iter = itertools.chain(list1, range(a, b))



More information about the Digitalmars-d mailing list