#!/usr/bin/env python2 s = "Madam" print s print ''.join([s[i] for i in range(len(s)-1, -1, -1)])