tzot

Όλα τα φωνήεντα άπαξ

Jun 17th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. import unicodedata as ud
  2. import re
  3. import fileinput
  4.  
  5. re_vowels= re.compile('[αεηιουω]')
  6.  
  7. def unaccented_vowels(word):
  8.     return re_vowels.findall(ud.normalize('NFD', word.lower()))
  9.  
  10. def all_vowels_once(word):
  11.     l= unaccented_vowels(word)
  12.     return len(l) == 7 and len(frozenset(l)) == 7
  13.  
  14. def main():
  15.     for word in filter(all_vowels_once, fileinput.input()):
  16.         print(word.rstrip())
  17.  
  18. if __name__ == "__main__":
  19.     main()
Advertisement
Add Comment
Please, Sign In to add comment