def seven_seg(a: bool, b: bool, c: bool, d: bool, e: bool, f: bool, g: bool) -> str:
    """Given a set of 7 boolean values corresponding to each segment, returns
    a string representation of a 7 segment display.

    The display looks like this:
         _
        |_|
        |_|

    And the mapping of the booleans is as follows:
         a
        fgb
        edc
    """

    return (
        (" _" if a else "") + "\n"
        + ("|" if f else " ") + ("_" if g else " ") + ("|" if b else "") + "\n"
        + ("|" if e else " ") + ("_" if d else " ") + ("|" if c else "") + "\n")