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
Discussions

Reverse while loop python - Stack Overflow
Reversing a while loop. I am having issues grasping the concept of reversing the while loop. Please Help b=1 while b= 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
iterate over a string in reverse
https://docs.python.org/3/library/functions.html#reversed More on reddit.com
🌐 r/learnpython
7
1
February 7, 2023
How to Loop Backwards in Python? - TestMu AI Community
How can I loop backwards from 100 to 0 in Python using a backwards range python? I tried using for i in range(100, 0), but it doesn’t work as expected. How can I fix this to achieve a backward loop? More on community.testmu.ai
🌐 community.testmu.ai
0
December 8, 2024
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-reverse-string
Python Reverse String - 5 Ways and the Best One | DigitalOcean
August 3, 2022 - If you run above Python script, the output will be: ... def reverse_for_loop(s): s1 = '' for c in s: s1 = c + s1 # appending chars in reverse order return s1 input_str = 'ABç∂EF' if __name__ == "__main__": print('Reverse String using for loop =', reverse_for_loop(input_str)) ... def reverse_while_loop(s): s1 = '' length = len(s) - 1 while length >= 0: s1 = s1 + s[length] length = length - 1 return s1 input_str = 'ABç∂EF' if __name__ == "__main__": print('Reverse String using while loop =', reverse_while_loop(input_str))
🌐
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=' ')
🌐
Know Program
knowprogram.com › home › reverse a number in python using while loop
Reverse a Number in Python using While Loop
December 15, 2021 - Then, find the reverse of a number using the while loop and finally, the result will be displayed on the screen. # Python program to reverse a number using while loop # take inputs num = 12345 # calculate reverse of number reverse = 0 while(num > 0): last_digit = num % 10 reverse = reverse * 10 + last_digit num = num // 10 # display result print('The reverse number is =', reverse)
🌐
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 by 10 is stored in the variable digit digit = num % 10 reversed_num = reversed_num * 10 + digit num //= 10 print("Reversed Number: " + str(reversed_num))
🌐
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 Forum
python-forum.io › thread-26223.html
while loop reading list in reverse
I have written some simple code that should read a list and return a result for each item in the list sandwich_orders = finished_orders = [] print("Sorry we have run out of pastrami") while 'pastrami'
🌐
Stack Overflow
stackoverflow.com › questions › 67813959 › reverse-while-loop-python
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.
🌐
Mimo
mimo.org › glossary › python › for-loop
Python For Loop: Syntax and Examples [Python Tutorial]
You can achieve this with the ... enumerate(fruits): print(f"Index {index}: {fruit}") You can loop over a sequence in reverse order by using the reversed() Python function....
🌐
Codecademy
codecademy.com › article › how-to-reverse-a-list-in-python
How to Reverse a List in Python | Codecademy
You can use slicing ([::-1]), ... 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....
🌐
Python Morsels
pythonmorsels.com › looping-in-reverse
Looping in reverse - Python Morsels
May 27, 2025 - But for iterables that can be reversed, you can use the built-in reversed function to loop backward. ... We don't learn by reading or watching. We learn by doing. That means writing Python code.
🌐
TestMu AI Community
community.testmu.ai › ask a question
How to Loop Backwards in Python? - TestMu AI Community
December 8, 2024 - How can I loop backwards from 100 to 0 in Python using a backwards range python? I tried using for i in range(100, 0), but it doesn’t work as expected. How can I fix this to achieve a backward loop?
🌐
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 - while n > 0: r = n % 10 # Extract the last digit rev = (rev * 10) + r # Build the reversed number n = n // 10 # Remove the last digit print(rev) # Output: 4321 ... 4th Pass1 > 0 (True)r = 1 % 10 = 11 rev = (432 * 10) + 1 = 43211 // 10 = 05th Pass0 > 0 (False)Loop stops--
🌐
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))