How can I make an array start at subscript 1 instead of subscript 0 in python?
Basically to solve this problem in python.
How can I make an array start at subscript 1 instead of subscript 0 in python?
Basically to solve this problem in python.
You can use custom indexes of the fidx module:
import fidx
# create custom type `list1b` from `list`
fidx.add(list, name='list1b')
# add a map for int indexes (i -> i-1)
fidx.list1b.set_index_map(int, lambda _,i: i-1, override=True)
# create your list
b = fidx.list1b([1,2,3])
print(b[1], b[2], b[3]) # (1, 2, 3)