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
🌐
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 - Python comes with a number of methods and functions that allow you to reverse a list, either directly or by iterating over the list object. You’ll learn how to reverse a Python list by using the reversed() function, the .reverse() method, list indexing, for loops, list comprehensions, and the slice method.
Discussions

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
python - How do I reverse a list or loop over it backwards? - Stack Overflow
My solution is right! You know how python implements indexing. From right to left you have 0,1,2... and from left to right you have -1,-2,-3.. etc. To reverse a list, you cut it into two parts and you multiply the indexes on the right by their opposites on the left minus one. More on stackoverflow.com
🌐 stackoverflow.com
loops - Traverse a list in reverse order in Python - Stack Overflow
How do I traverse a list in reverse order in Python? So I can start from collection[len(collection)-1] and end in collection[0]. I also want to be able to access the loop index. 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
🌐
Programiz
programiz.com › python-programming › methods › list › reverse
Python List reverse()
Python List index() Python List append() Python List extend() Python List insert() Python List remove() Python List count() Python List pop() Python List reverse() Python List sort() Python List copy() Python List clear() Python List sort() Python reversed() Python List remove() Python List clear() Python List insert() Python List ·
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-reversing-list
Reversing a List in Python - GeeksforGeeks
This method builds a reversed version of the list using slicing with a negative step. ... Python's built-in reversed() function is another way to reverse the list.
Published   November 26, 2025
🌐
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.
🌐
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 - Besides using while and for loops or the reverse() function, it is also possible to use the indexing operator for slicing lists. The syntax for slicing list elements using indexes is this: list[start:stop:step]. “Start” denotes the index of the first element that you want to retrieve · “Stop” denotes the index of the last element that you want to retrieve · “Step” denotes the increment between each index for slicing · For example, if we type countries[1:5:2], Python will print Croatia and Iceland.
🌐
Real Python
realpython.com › python-reverse-list
Reverse Python Lists: Beyond .reverse() and reversed() – Real Python
June 28, 2023 - When you run this trick, you get a copy of the original list in reverse order without affecting the input data. If you fully rely on implicit indices, then the slicing syntax gets shorter, cleaner, and less error-prone: ... >>> digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> # Rely on default index values >>> digits[::-1] [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] Here, you ask Python to give you the complete list ([::-1]) but going over all the items from back to front by setting step to -1.
Find elsewhere
🌐
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 list is defined and then the variable index is defined that stores the list’s index value by taking the list’s length 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.
🌐
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 - This method gives flexibility in customizing the reversal process. It is useful when more complex operations need to be performed during the reversal. Python’s reversed() function offers an easy method to reverse the elements of a list.
🌐
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.
🌐
Codecademy
codecademy.com › article › how-to-reverse-a-list-in-python
How to Reverse a List in Python | Codecademy
The for loop iterates through the list in reverse order using a decrementing index, appending each element to a new list.
🌐
Geek Python
geekpython.in › different-ways-to-reverse-a-python-list
8 Different Ways To Reverse A Python List
August 26, 2023 - List indexing can be done using the format [start : stop: step]. For example, [: : 1] will return the whole list from start to end. Similarly, [: : -1] will return the whole list but in reversed order. Let’s see an example.
🌐
Reddit
reddit.com › r/python › you can use [~i] for reverse indexing rather than [-i-1]
r/Python on Reddit: You can use [~i] for reverse indexing rather than [-i-1]
March 2, 2017 -

Friend told me this yesterday, kind of blew my mind. Had never seen this before.

from https://wiki.python.org/moin/BitwiseOperators ~ x Returns the complement of x - the number you get by switching each 1 for a 0 and each 0 for a 1. This is the same as -x - 1

🌐
Python documentation
docs.python.org › 3 › tutorial › datastructures.html
5. Data Structures — Python 3.14.3 documentation
The returned index is computed relative to the beginning of the full sequence rather than the start argument. ... Return the number of times x appears in the list. ... Sort the items of the list in place (the arguments can be used for sort customization, see sorted() for their explanation). ... Reverse the elements of the list in place.
🌐
W3Schools
w3schools.com › python › ref_list_reverse.asp
Python List reverse() Method
The built-in function reversed() returns a reversed iterator object. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
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.
🌐
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: