+ 5

Python/javascript isogram

someone help me with the code to remove all repeating chars on a word: isogram and also prints the number of repeating values removed using functions maybe you can try and fix this but include the number of characters emitted https://code.sololearn.com/ck8vF7k2M4zx/?ref=app

30th Jun 2017, 4:48 AM
Krafty Coder
Krafty Coder - avatar
2 Antworten
+ 1
# you can use set to quickly filter duplicates in a string def isIsogram(word): unique_letters = set(word) length_difference = len(word)-len(unique_letters) if length_difference == 0: return (word,True) else: return (word,False,length_difference) print(isIsogram('abcdefghi')) print(isIsogram('aabbccdd'))
30th Jun 2017, 7:20 AM
richard
3rd Mar 2018, 6:54 AM
Vikash Pal
Vikash Pal - avatar