Remember this Thread Dixon? and use code tag.
So there did i post full working setup,that takes it also one step further as also making a wheel.
The vvsearch module will also of course working stand alone,it's from the book you did read Head first Python.
I did a called it
So there did i post full working setup,that takes it also one step further as also making a wheel.
The vvsearch module will also of course working stand alone,it's from the book you did read Head first Python.
I did a called it
v
vsearch,so you should avoid conflict if already make vsearch.# vvsearch.py def search4vowels(phrase: str) -> set: vowels = set('aeiou') return vowels.intersection(set(phrase)) def search4letters(phrase: str, letters: str) -> set: return set(letters).intersection(set(phrase)) if __name__ == '__main__': print(search4letters('hitch-hiker', 'aeiou')) print(search4letters('galaxy', 'xyz')) print(search4letters('life, the universe, and everything', 'o'))Usage if import:
C:\code λ ptpython >>> import vvsearch >>> vvsearch.search4vowels('abcde') {'e', 'a'} >>> vvsearch.search4letters('hello', 'aeiou') {'e', 'o'}