Pangrams

  • + 0 comments

    Python 3 solutions:

    import string
    import typing
    
    
    ALPHABET: set[str] = {*string.ascii_uppercase}
    
    
    def pangrams(s: str) -> typing.Literal["pangram", "not pangram"]:
        return "pangram" if {*s.upper()} >= ALPHABET else "not pangram"
    
    
    def pangrams(s: str) -> typing.Literal["pangram", "not pangram"]:
        return "not pangram"[4 * (len({*s.upper().replace(" ", "")}) == 26) :]
    
    
    pangrams=lambda s:(len({*s.upper()}-{" "})<26)*"not "+"pangram"  # 63