You don't have that choice. Python indexing starts at 0, and is not configurable.

You can just subtract 1 from your indices when indexing:

array.insert(i - 1, element)  # but better just use array.append(element)
print(i, array[i - 1])

or (more wasteful), start your list with a dummy value at index 0:

array = [None]

at which point the next index used will be 1.

Answer from Martijn Pieters on Stack Overflow
🌐
NumPy
numpy.org › doc › stable › user › basics.indexing.html
Indexing on ndarrays — NumPy v2.4 Manual
Basic slicing extends Python’s basic concept of slicing to N dimensions. Basic slicing occurs when obj is a slice object (constructed by start:stop:step notation inside of brackets), an integer, or a tuple of slice objects and integers. Ellipsis and newaxis objects can be interspersed with these as well. The simplest case of indexing with N integers returns an array ...
🌐
W3Schools
w3schools.com › python › numpy › numpy_array_indexing.asp
NumPy Array Indexing
The indexes in NumPy arrays start with 0, meaning that the first element has index 0, and the second has index 1 etc.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-array-indexing
Python Array Indexing - GeeksforGeeks
July 23, 2025 - import array # Create an array ... print(arr[1]) print(arr[4]) ... In Python, arrays support negative indexing where the last element of the array is accessed with index -1, the second-to-last element with index -2 and ...
🌐
AskPython
askpython.com › home › array indexing in python – beginner’s reference
Array Indexing in Python - Beginner's Reference - AskPython
February 22, 2021 - In order to access specific elements from an array, we use the method of array indexing. The first element starts with index 0 and followed by the second element which has index 1 and so on.
🌐
NumPy
numpy.org › devdocs › user › basics.indexing.html
Indexing on ndarrays — NumPy v2.5.dev0 Manual
Basic slicing extends Python’s basic concept of slicing to N dimensions. Basic slicing occurs when obj is a slice object (constructed by start:stop:step notation inside of brackets), an integer, or a tuple of slice objects and integers. Ellipsis and newaxis objects can be interspersed with these as well. The simplest case of indexing with N integers returns an array ...
🌐
Problem Solving with Python
problemsolvingwithpython.com › 05-NumPy-and-Arrays › 05.05-Array-Indexing
Array Indexing - Problem Solving with Python
Where <value> is the value pulled out of the 2-D array and [row,col] specifies the row and column index of the value. Remember Python counting starts at 0, so the first row is row zero and the first column is column zero.
🌐
Quora
quora.com › In-Python-where-from-the-indexing-starts-0-or-1
In Python, where from the indexing starts 0 or 1? - Quora
Answer (1 of 51): Basically index categories in two types : Positive indexing : here index start from '0′. Examples: suppose our list list1=[1, 2,3,4] Indexes: 0,1,2,3 list1[0]=1 list1[1]=2….. Like that Negative indexing : here index start ...
Find elsewhere
🌐
HackerEarth
hackerearth.com › practice › notes › samarthbhargav › a-quick-intro-to-indexing-in-python
A Quick intro to Indexing in Python - Samarth Bhargav
So a step size of 1 tells python to pick every element, a step size of 2 means pick alternate elements, and so on. The step size is specified after the end-index, preceded by a colon. i.e ... Of course, if you leave start_index and end_index blank, python assumes its 0 and len(my_list).
🌐
Railsware
railsware.com › home › engineering › indexing and slicing for lists, tuples, strings, other sequential types in python
Python Indexing and Slicing for Lists, Tuples, Strings, other Sequential Types | Railsware Blog
January 22, 2025 - ... >>> nums = [10, 20, 30, 40, ... slice: 2:7. The full slice syntax is: start:stop:step. start refers to the index of the element which is used as a start of our slice....
Top answer
1 of 5
15

The index method does not do what you expect. To get an item at an index, you must use the [] syntax:

>>> my_list = ['foo', 'bar', 'baz']
>>> my_list[1]  # indices are zero-based
'bar'

index is used to get an index from an item:

>>> my_list.index('baz')
2

If you're asking whether there's any way to get index to recurse into sub-lists, the answer is no, because it would have to return something that you could then pass into [], and [] never goes into sub-lists.

2 of 5
6

list is an inbuilt function don't use it as variable name it is against the protocol instead use lst.

To access a element from a list use [ ] with index number of that element

lst = [1,2,3,4]
lst[0]
1

one more example of same

lst = [1,2,3,4]
lst[3]
4

Use (:) semicolon to access elements in series first index number before semicolon is Included & Excluded after semicolon

lst[0:3]
[1, 2, 3]

If index number before semicolon is not specified then all the numbers is included till the start of the list with respect to index number after semicolon

lst[:2]
[1, 2]

If index number after semicolon is not specified then all the numbers is included till the end of the list with respect to index number before semicolon

lst[1:]
[2, 3, 4]

If we give one more semicolon the specifield number will be treated as steps

lst[0:4:2]
[1, 3]

This is used to find the specific index number of a element

lst.index(3)
2

This is one of my favourite the pop function it pulls out the element on the bases of index provided more over it also remove that element from the main list

lst.pop(1)
2

Now see the main list the element is removed..:)

lst
[1, 3, 4]

For extracting even numbers from a given list use this, here i am taking new example for better understanding

lst = [1,1,2,3,4,44,45,56]

import numpy as np

lst = np.array(lst)
lst = lst[lst%2==0]
list(lst)
[2, 4, 44, 56]

For extracting odd numbers from a given list use this (Note where i have assingn 1 rather than 0)

lst = [1,1,2,3,4,44,45,56]

import numpy as np

lst = np.array(lst)
lst = lst[lst%2==1]
list(lst)
[1, 1, 3, 45]

Happy Learning...:)

🌐
Enchantia
enchantia.com › graphapp › doc › tech › arrays1.html
Arrays Indexed From One
To obtain an element from an array, we use this notation: A[i] Here, we assume the index i starts at the correct value for the corresponding scheme, so in C or Python we would start i at 0, and in IndexFrom1 we'd start at 1 (thus, i is whatever is most convenient to use for any given language).
🌐
Quora
quora.com › Why-does-Python-start-at-index-1-when-iterating-an-array-backwards
Why does Python start at index 1 when iterating an array backwards? - Quora
Answer (1 of 4): It doesn’t, it starts at -1. But before we get to that, we should note that whether we’re talking about a list, string, tuple, or other iterable, Python indices are actually offsets. Let’s just use a list (as opposed to an array, which is not a native Python datatype).
Top answer
1 of 7
186

To explain it in another way, because -0 is equal to 0, if backward starts from 0, it is ambiguous to the interpreter.


If you are confused about -, and looking for another way to index backwards more understandably, you can try ~, it is a mirror of forward:

arr = ["a", "b", "c", "d"]
print(arr[~0])   # d
print(arr[~1])   # c

The typical usages for ~ are like "swap mirror node" or "find median in a sort list":

"""swap mirror node"""
def reverse(arr: List[int]) -> None:
    for i in range(len(arr) // 2):
        arr[i], arr[~i] = arr[~i], arr[i]

"""find median in a sort list"""
def median(arr: List[float]) -> float:
    mid = len(arr) // 2
    return (arr[mid] + arr[~mid]) / 2

"""deal with mirror pairs"""
# verify the number is strobogrammatic, strobogrammatic number looks the same when rotated 180 degrees
def is_strobogrammatic(num: str) -> bool:
    return all(num[i] + num[~i] in '696 00 11 88' for i in range(len(num) // 2 + 1))

~ actually is a math trick of inverse code and complement code, and it is more easy to understand in some situations.


Discussion about whether should use python tricks like ~:

In my opinion, if it is a code maintained by yourself, you can use any trick to avoid potential bug or achieve goal easier, because of maybe a high readability and usability. But in team work, avoid using 'too clever' code, may bring troubles to your co-workers.

For example, here is one concise code from Stefan Pochmann to solve this problem. I learned a lot from his code. But some are just for fun, too hackish to use.

# a strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down)
# find all strobogrammatic numbers that are of length = n
def findStrobogrammatic(self, n):
    nums = n % 2 * list('018') or ['']
    while n > 1:
        n -= 2
        # n < 2 is so genius here
        nums = [a + num + b for a, b in '00 11 88 69 96'.split()[n < 2:] for num in nums]
    return nums

I have summarized python tricks like this, in case you are interested.

2 of 7
175
list[-1]

Is short hand for:

list[len(list)-1]

The len(list) part is implicit. That's why the -1 is the last element. That goes for any negative index - the subtraction from len(list) is always implicit

🌐
Hpc-carpentry
hpc-carpentry.org › hpc-python › 03-lists › index.html
Numpy arrays and lists – Introduction to High-Performance Computing in Python
January 20, 2023 - We add a set of square brackets after the list in question along with the index of the values we want. Note that in Python, all indices start from 0 — the first element is actually the 0th element (this is different from languages like R or MATLAB). The best way to think about array indices ...
🌐
freeCodeCamp
freecodecamp.org › news › python-array-tutorial-define-index-methods
Python Array Tutorial – Define, Index, Methods
January 31, 2022 - It is important to remember that counting starts at 0 and not at 1. To access an element, you first write the name of the array followed by square brackets. Inside the square brackets you include the item's index number.
🌐
DataCamp
datacamp.com › tutorial › python-list-index
Python List index() Method Explained with Examples | DataCamp
March 28, 2025 - Learn how to use Python's index() function to find the position of elements in lists. Includes examples, error handling, and tips for beginners.
🌐
Data-apis
data-apis.org › array-api › 2022.12 › API_specification › indexing.html
Indexing — Python array API standard 2022.12 documentation
To index a single array axis, an array must support standard Python indexing rules. Let n be the axis (dimension) size. An integer index must be an object satisfying operator.index (e.g., int). Nonnegative indices must start at 0 (i.e., zero-based indexing).