I would say to make the while loop act like a for loop.

firstList = [1,2,3]
secondList=[]

counter = len(firstList)-1

while counter >= 0:
    secondList.append(firstList[counter])
    counter -= 1
Answer from Blue on Stack Overflow
🌐
OneCompiler
onecompiler.com › posts › 3z2wjwde7 › reverse-an-array-list-using-while-loop-python
Reverse an array(list) using while loop Python - Posts - OneCompiler
Step 6: Print reversed list i.e. revArr ... Following is sample Python code. # taking the input from the user to fix the array size size=int(input("Enter the number of elements you want in array: ")) # Create two empty lists arr=[] revArr=[] # adding the elements to the list for i in range(0,size): elem=int(input("Please give value for index "+str(i)+": ")) arr.append(elem) startIndex = 0; lastIndex = size - 1; # iterate the while loop till the lastindex 0 while (lastIndex>=0): revArr.append(arr[lastIndex]) startIndex+=1 lastIndex-=1 # printing the reversed list print("Array in reverse order") for i in range(0,size): print(revArr[i],end=' ')
Discussions

iteration - How to loop backwards in python? - Stack Overflow
I can think of some ways to do so in python (creating a list of range(1,n+1) and reverse it, using while and --i, ...) but I wondered if there's a more elegant way to do it. More on stackoverflow.com
🌐 stackoverflow.com
Reverse while loop python - Stack Overflow
I am having issues grasping the concept of reversing the while loop. Please Help · b=1 while b=<6: d=1 while d<=b: print("1",end="") d+=1 print() b+=1 ... I would recommend cleaning up the indentation. I am guessing you have two nested loops, but as it is written, this won't run in Python. More on stackoverflow.com
🌐 stackoverflow.com
Reversing a string in Python using a loop? - Stack Overflow
I'm stuck at an exercise where I need to reverse a random string in a function using only a loop (for loop or while?). I can not use ".join(reversed(string)) or string[::-1] methods here so it's a... More on stackoverflow.com
🌐 stackoverflow.com
Why isn't my loop iterating backwards in python?
Hint: Look up documentation on the ‘range’ function…does it actually do what you think it does given the two arguments you provided? Maybe you’re missing an argument? https://docs.python.org/3/library/stdtypes.html#range More on reddit.com
🌐 r/learnprogramming
13
0
March 8, 2023
🌐
Programiz
programiz.com › python-programming › examples › reverse-a-number
Python Program to Reverse a Number
To understand this example, you should have the knowledge of the following Python programming topics: ... num = 1234 reversed_num = 0 while num != 0: digit = num % 10 reversed_num = reversed_num * 10 + digit num //= 10 print("Reversed Number: " + str(reversed_num))
🌐
Newtum
blog.newtum.com › reverse-a-number-in-python-using-while-loop
Reverse a Number in Python Using While Loop - Newtum
April 25, 2024 - # Reverse a Number in python using while Loop # we are taking a number from user as input # entered value will be converted to int from string num = int(input("Enter the number:")) reversed_num = 0 while num != 0: # remainder of the num divided ...
🌐
Medium
medium.com › @shaikshabbeer643 › write-a-python-program-to-reverse-a-given-positive-integer-using-a-while-loop-7e9b693fedc0
Write a Python program to reverse a given positive integer using a while loop. | by Shaik Shabbeer | Medium
May 14, 2025 - 4th Pass1 > 0 (True)r = 1 % 10 = 11 rev = (432 * 10) + 1 = 43211 // 10 = 05th Pass0 > 0 (False)Loop stops-- rev * 10 shifts the current digits of rev left by 1 place (adds a 0 at the end). Example: If rev = 4, then rev * 10 = 40.
🌐
Tutorial Gateway
tutorialgateway.org › python-program-to-reverse-a-number
Python Program to Reverse a Number
April 7, 2025 - Next, Condition in the Python While loop ensures that the given number is greater than 0. From the above Python example program, the User Entered integer value: Number = 1456 and Reverse = 0
🌐
GeeksforGeeks
geeksforgeeks.org › python › backward-iteration-in-python
Backward iteration in Python - GeeksforGeeks
July 11, 2025 - a = [1, 2, 3, 4, 5] #Loop through the List # reverse order using slicing(::-1) for item in a[::-1]: print(item) # same logic written using List comprehension # [print(item) for item in a[::-1]] ... Using a while loop provides you control over ...
Find elsewhere
🌐
Python Morsels
pythonmorsels.com › looping-in-reverse
Looping in reverse - Python Morsels
May 27, 2025 - If you're working with a list, ... using Python's slicing syntax: >>> colors = ["purple", "blue", "green", "pink", "red"] >>> colors[::-1] ['red', 'pink', 'green', 'blue', 'purple'] The syntax looks weird, but it does ...
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-reverse-string
Python Reverse String - 5 Ways and the Best One | DigitalOcean
August 3, 2022 - $ python3.7 -m timeit --number 100000 --unit usec 'import string_reverse' 'string_reverse.reverse_slicing("ABç∂EF"*10)' 100000 loops, best of 5: 0.449 usec per loop $ python3.7 -m timeit --number 100000 --unit usec 'import string_reverse' 'string_reverse.reverse_list("ABç∂EF"*10)' 100000 loops, best of 5: 2.46 usec per loop $ python3.7 -m timeit --number 100000 --unit usec 'import string_reverse' 'string_reverse.reverse_join_reversed_iter("ABç∂EF"*10)' 100000 loops, best of 5: 2.49 usec per loop $ python3.7 -m timeit --number 100000 --unit usec 'import string_reverse' 'string_reverse.
🌐
Real Python
realpython.com › python-reverse-list
Reverse Python Lists: Beyond .reverse() and reversed() – Real Python
June 28, 2023 - Note: Most of the examples in this tutorial use a list of numbers as input. However, the same tools and techniques apply to lists of any type of Python objects, such as lists of strings. Okay! That was quick and straightforward! Now, how can you reverse a list in place by hand? A common technique is to loop through the first half of it while ...
🌐
W3Schools
w3schools.com › python › python_while_loops.asp
Python While Loops
Remove List Duplicates Reverse a String Add Two Numbers · Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Certificate Python Training ... With the while loop we can execute ...
🌐
Codecademy
codecademy.com › article › how-to-reverse-a-list-in-python
How to Reverse a List in Python | Codecademy
The original list remains unchanged. You can reverse a list using a while loop by swapping elements from the start and end of the list until the two pointers meet in the middle. Here’s an example...
🌐
Tutorial Gateway
tutorialgateway.org › python-program-to-reverse-string
Python Program to Reverse a String
January 4, 2026 - For example, st1 = Hello. In the first iteration, st2 is H. In the second iteration, e is placed in the first position, and H pushes to the last position. st1 = input("Please enter your own: ") st2 = '' for i in st1: st2 = i + st2 print("After = ", st2) ...
🌐
Python Guides
pythonguides.com › reverse-a-list-in-python
How to Reverse a List in Python
September 30, 2025 - Learn how to reverse a list in Python using slicing, loops, reverse() method, and more. Step-by-step guide with practical code examples for beginners and pros.
🌐
Stack Overflow
stackoverflow.com › questions › 67813959 › reverse-while-loop-python
Reverse while loop python - Stack Overflow
Please Help · b=1 while b=<6: d=1 while d<=b: print("1",end="") d+=1 print() b+=1 ... I would recommend cleaning up the indentation. I am guessing you have two nested loops, but as it is written, this won't run in Python.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-reversing-list
Reversing a List in Python - GeeksforGeeks
Python · a = [1, 2, 3, 4, 5] i, j = 0, len(a) - 1 while i < j: a[i], a[j] = a[j], a[i] i += 1 j -= 1 print(a) Try it on GfG Practice · Output · [5, 4, 3, 2, 1] Explanation: i starts at the beginning and j at the end. a[i], a[j] = a[j], a[i] ...
Published   November 26, 2025
🌐
Python Morsels
pythonmorsels.com › while-loops
Python's "while" loop - Python Morsels
June 20, 2025 - Similarly, here we're using a while loop to loop over a list in reverse: