In article <4da83f8f0ドル29986ドル$c3e8da3$5496439d at news.astraweb.com>, Steven D'Aprano <steve+comp.lang.python at pearwood.info> wrote: > for key in dct: > if key.startswith("Keyword"): > maxkey = max(maxkey, int(key[7:])) I would make that a little easier to read, and less prone to "Did I count correctly?" bugs with something like: prefix = "Keyword" n = len(prefix) for key in dct: name, value = key[:n], key[n:] if name == prefix: maxkey = max(maxkey, int(value))