Reversal of a string

startmsg = "hello"
endmsg = ""
for i in range(0,len(startmsg)):
  endmsg = startmsg[i] + endmsg
print (endmsg)

No comments: