for i in range(len(primo)):
reversed_num = 0
while i > 0:
digit = i % 10
reversed_num = reversed_num * 10 + digit
i //= 10
reversed.append (reversed_num)
for r in range(len(reversed)):
print (r)
I'm writing a program to reverse a series of numbers from a list. For example:
Input: 1234,124,654
Output: 4321,421,456
The script works correctly with one number, but with a list it doesn't work properly.