- Notifications
You must be signed in to change notification settings - Fork 638
Expand file tree
/
Copy pathP55_Isogram.py
More file actions
Latest commit
29 lines (25 loc) · 1.18 KB
/
Copy pathP55_Isogram.py
File metadata and controls
29 lines (25 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Author: OMKAR PATHAK
# ISOGRAM: An isogram (also known as a "nonpattern word") is a logological term for a word
# or phrase without a repeating letter
defis_isogram(word):
# Convert the word or sentence in lower case letters.
clean_word=word.lower()
# Make ann empty list to append unique letters
letter_list= []
forletterinclean_word:
# If letter is an alphabet then only check
ifletter.isalpha():
ifletterinletter_list:
returnFalse
letter_list.append(letter)
returnTrue
if__name__=='__main__':
print(is_isogram("")) # True
print(is_isogram("isogram")) # True
print(is_isogram("eleven")) # False
print(is_isogram("subdermatoglyphic")) # True
print(is_isogram("Alphabet")) # False
print(is_isogram("thumbscrew-japingly")) # True
print(is_isogram("Hjelmqvist-Gryb-Zock-Pfund-Wax")) # True
print(is_isogram("Emily Jung Schwartzkopf")) # True
print(is_isogram("accentor")) # False