I have taken the input from the user and then converted the string into the list object using the split method. Then reversed the list using reverse function and it is working well. But the problem is that I'm unable to get the last word from the string.
I'm have checked my loop and it's working fine.
s=input('enter any string:')
l=s.split()
l1=reversed(l)
for i in l1:
l2=' '.join(l1)
print(l2)
input:
learning python is very easy
output:
very is python learning