Or, slighly slower, but more general: def swap(s, order=(3,4,2,0,1)): # assert len(s) >= len(order) return ''.join([s[o] for o in order]) + s[6:]
-- http://mail.python.org/mailman/listinfo/python-list
Or, slighly slower, but more general: def swap(s, order=(3,4,2,0,1)): # assert len(s) >= len(order) return ''.join([s[o] for o in order]) + s[6:]
-- http://mail.python.org/mailman/listinfo/python-list