Q:

I want to reverse a string and i have written the code for it but it's not giving any output

The code is not giving any output.
I've tried storing the words in a list using input().split(".") and then running the for loop from len(list)-1 to 0 and appending it to another list but the other list is not getting populated.
s1= list()
a = list(map(str, input().rstrip().split(".")))
for i in range(len(a)-1,0):
  s1.append(a[i]+".")
print(s1) 

Input text: 'this.is.a.test'
Expected output should be ['test','a','is','this']
Acual output is this []

A:

The for-loop does not run, because the start of range is larger than the end. You need a step of -1 to run from high values to lower ones.
But you have to remember, that end is not included:
for i in range(len(a)-1, -1, -1):
    s1.append(a[i])

But in python, you should avoid to iterate over an index, but iterate over elements of the list, to run in reverse, use reversed:
for element in reversed(a):
    s1.append(element)

which is the same as
s1 = list(reversed(a))

Putting all together you get:
text = input()
parts = text.rstrip().split(".") # no need for map, because split returns a list of strings.
print(".".join(reversed(parts)))

