>>> a 'string' >>> f2=open("f2","w") >>> i=-1 >>> while i >= -len(a): ... f2.write(a[i]) ... print a[i], ... i=i-1 ... g n i r t s