def next_key(key):
 mutable_key = list(key)
 mutable_key[(-1)] = chr((ord(key[(-1)]) + 1))
 return ''.join(mutable_key)

def next_key ( key ) : mutable_key = list ( key ) mutable_key [ ( - 1 ) ] = chr ( ( ord ( key [ ( - 1 ) ] ) + 1 ) ) return '' . join ( mutable_key )
processes a tuple of 2-element tuples and returns the key which comes after the given key .