easy +8 pts

Is isogram?

Determine if a word is an isogram — no letter appears more than once.

An isogram is a word or phrase in which no letter occurs more than once. Your task is to implement the function `is_isogram(word)` that returns `True` if the given word is an isogram, and `False` otherwise. Rules: - The check is case-insensitive: 'A' and 'a' are considered the same letter. - Ignore all non-alphabetic characters (spaces, hyphens, digits, punctuation, etc.) — they do not count. - An empty word or a word with no alphabetic characters is considered an isogram. For example: `'isogram'` is an isogram, `'documentarily'` is an isogram, but `'alpha'` is not because 'a' appears twice. `'Alphabet'` is not an isogram (case-insensitive). `'six-year-old'` is an isogram because only letters matter. Implement the function exactly as specified. Do not include extra output or input handling.

Constraints

Input is a string. Length of input is not explicitly limited but will be manageable in typical testing. Output must be a boolean.

Example

>>> is_isogram('isogram')
True
>>> is_isogram('alpha')
False
>>> is_isogram('Alphabet')
False
>>> is_isogram('six-year-old')
True
>>> is_isogram('')
True
8 points ~12 min

Recent Submissions

No submissions yet — hit Run Tests to try!

Hints

Convert the word to lowercase (or uppercase) before comparing letters.
Use a set to track letters you have already seen.
Filter out non-alphabetic characters using `str.isalpha()`.
Python 3
All tests passed!
Test Results
Press Ctrl+Enter or click Run Tests to execute your code.