Wednesday, June 10, 2015

Reverse a string - Python

st = "awesome!"
st1 = ''
ls = len(st)
for x in range(len(st)):
st1 = st1 + st[ls - 1- x]
print st1

No comments:

Post a Comment