This is the code I have written:
import sys
import string
def reverse(li):
li=li[::-1]
return li
a=raw_input("Enter first line ")
c=[]
c=a[0:2]
a=reverse(a)
b=[]
i=0
for i in range(0, len(a)):
if(a[i]==' '):
b=a[:i]
b=reverse(b)
b.append(c)
print b
Here the error is: 'str' object has no attribute 'append' on line b.append(c).
Why is this error creeping up? Where am I going wrong?