try:
    return next(('[%s] = %s' % (k, D.get(k)) for k in D if search_string.lower()
        .strip() in k.lower()))
except StopIteration:
    return 'No matches found'
Python: Finding a (string) key in a dictionary that contains a substring