79809232

Date: 2025-11-04 17:55:57
Score: 1
Natty:
Report link

are you looking for something like a list comprehension or generator expression?

from typing import Iterator
def matching_keys(d: dict[tuple[int,int], int], n:int) -> Iterator[tuple[int,int]]:
    return (
        keypair
        for keypair in d
        if keypair[0] == n
    )
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-1):
Posted by: J Earls