import re astring = 'hello world' revchars = astring[::-1] print(revchars)