I think you're overthinking this:

First, reverse the list:

inverselist = k1[::-1]

Then, replace the first nonzero element:

for i, item in enumerate(inverselist):
    if item:
        inverselist[i] += 100
        break
Answer from Tim Pietzcker on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-reversing-list
Reversing a List in Python - GeeksforGeeks
Python's built-in reversed() function is another way to reverse the list. However, reversed() returns an iterator, so it needs to be converted back into a list. ... If we want to reverse a list manually, we can use a loop (for loop) to build ...
Published ย  November 26, 2025
Discussions

python - How do I reverse a list or loop over it backwards? - Stack Overflow
How do I iterate over a list in reverse in Python? See also: How can I get a reversed copy of a list (avoid a separate statement when chaining a method after .reverse)? More on stackoverflow.com
๐ŸŒ stackoverflow.com
Why does [::-1] reverse a list?
[Start:stop:step] if you're going in steps by negative one, you're going backwards More on reddit.com
๐ŸŒ r/learnpython
57
187
March 12, 2022
Reverse Indexing in Python? - Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most. Learn more about Collectives ... Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... I know that a[end:start:-1] slices a list in a reverse order. More on stackoverflow.com
๐ŸŒ stackoverflow.com
You can use [~i] for reverse indexing rather than [-i-1]
PEP 20: "cryptic is better than clear" More on reddit.com
๐ŸŒ r/Python
112
308
March 2, 2017
๐ŸŒ
Codecademy
codecademy.com โ€บ article โ€บ how-to-reverse-a-list-in-python
How to Reverse a List in Python | Codecademy
This approach is less commonly used but gives us full control over the reversal process. ... range(len(list_name) - 1, -1, -1): Iterates over the indices of the list in reverse order, starting from the last index and ending at 0
๐ŸŒ
datagy
datagy.io โ€บ home โ€บ python posts โ€บ how to reverse a python list (6 ways)
How to Reverse a Python List (6 Ways) โ€ข datagy
February 15, 2023 - List indexing takes the form of [start:stop:step]. For example, a_list[::1] would return the entire list from beginning to end. If we, instead, stepped using a value of -1, then we would traverse the list from the last item to the first.
๐ŸŒ
Real Python
realpython.com โ€บ python-reverse-list
Reverse Python Lists: Beyond .reverse() and reversed() โ€“ Real Python
June 28, 2023 - This diagram shows that you can access the first element of the list (or sequence) using either 0 or -5 with the indexing operator, like in sequence[0] and sequence[-5], respectively. You can use this Python feature to reverse the underlying sequence in place.
๐ŸŒ
Medium
geekpython.medium.com โ€บ 8-ways-to-reverse-the-elements-in-a-python-list-ad50889bdd7e
8 Ways To Reverse The Elements In A Python List | by Sachin Pal | Medium
November 25, 2022 - In the above Python program, a ... minus 1. Then created a list comprehension that accesses each index item of the list using the range function from the index to the end of the list in reverse order....
๐ŸŒ
W3Schools
w3schools.com โ€บ python โ€บ ref_list_reverse.asp
Python List reverse() Method
Python Examples Python Compiler ... Q&A Python Bootcamp Python Certificate Python Training ... The reverse() method reverses the sorting order of the elements....
Find elsewhere
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ python โ€บ python_reverse_a_list.htm
Python Reverse a List
The reverse() method in list class reverses the order of items in the list. The item in last index is relocated to 0th index, and one originally at index 0 goes to the last position.
๐ŸŒ
dbader.org
dbader.org โ€บ blog โ€บ python-reverse-list
How to Reverse a List in Python โ€“ dbader.org
July 11, 2017 - Reversing a list this way takes advantage of Pythonโ€™s โ€œslicingโ€ syntax that can be used to do a number of interesting things. List slicing uses the โ€œ[]โ€ indexing syntax with the following โ€œ[start:stop:step]โ€ pattern:
๐ŸŒ
Unstop
unstop.com โ€บ home โ€บ blog โ€บ reversing python list | 10 ways explained with code examples
Python Reverse List | 10 Ways & Complexity Analysis ...
February 3, 2025 - By using a specific slice notation [::-1], you can create a new list where the elements are arranged in reverse order. ... The syntax for slice operator isโ€“ list[start:stop:step]. Here, start is the index where the slice begins, stop is where ...
๐ŸŒ
Vertabelo
academy.vertabelo.com โ€บ blog โ€บ how-do-you-list-reverse-in-python
Vertabelo Academy Blog | How Do You List Reverse in Python?
March 3, 2020 - For example, by calling countries[5:1:-1], Python will return a sub-list of the elements at positions 5, 4, 3, and 2. The step is -1, so the starting index is 5 (Spain), and the stopping index is 1 (Croatia), which is not included in the sub-list: If you want to list reverse a whole list, there is no need to define starting and stopping positions.
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ python โ€บ list-reverse-method
Python List reverse() Method: Syntax, Methods, and Examples
This shows how to reverse a list using enumerate Python supports, and gives control over index manipulation.
๐ŸŒ
Cherry Servers
cherryservers.com โ€บ home โ€บ blog โ€บ python โ€บ how to reverse a list in python (using 3 simple ways)
How to Reverse a List in Python (Using 3 Simple Ways) | Cherry Servers
November 7, 2025 - Benefit from an open cloud ecosystem with seamless API & integrations and a Python library. ... To reverse a list in Python, two basic methods are commonly used, the built-in reverse() method and slicing with [::-1].
๐ŸŒ
Quora
quora.com โ€บ Why-does-my_list-1-reverse-a-list-in-python-Can-someone-explain-to-me-the-syntax
Why does my_list [::-1] reverse a list in python? Can someone explain to me the syntax? - Quora
The default for the first is the start of the list (i.e. 0). Python lists are zero-indexed, meaning the first element is in position 0. The default for the second is all the way to the end of the list. Note that when you use a two or three argument range and actually give it an end value, you have to give it an end value of the index of the element after the range you want.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ python-reverse-list-reversing-an-array-in-python
Python Reverse List โ€“ Reversing an Array in Python
September 6, 2022 - That said, it is more of an intermediate to advanced feature and not that beginner friendly compared to the .reverse() method, which is more intuitive and self-descriptive. Let's go over a quick overview of how slicing works.
๐ŸŒ
FavTutor
favtutor.com โ€บ blogs โ€บ reverse-list-python
Reverse Python List (9 Easy Ways) | FavTutor
March 30, 2022 - Start indicates the starting index, stop indicates the ending index plus 1 value, and step means the number of elements we want to skip. Step value 1 means it won't skip any elements and value 2 skips one element 3 means two elements and so on.