from typing import Tuple

text = """
The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
"""
vowels = 'aeiou'


def strip_vowels(text: str) -> Tuple[str, int]:
    """Replace all vowels in the input text string by a star
       character (*).
       Return a tuple of (replaced_text, number_of_vowels_found)

       So if this function is called like:
       strip_vowels('hello world')

       ... it would return:
       ('h*ll* w*rld', 3)

       The str/int types in the function definition above are part
       of Python's new type hinting:
       https://docs.python.org/3/library/typing.html"""

    new_string = []
    counter = 0

    # Break string down into individual unicode characters
    letters = [*text]

    for letter in letters:
        # Convert to lowercase since only lowercase vowels defined in vowels
        if letter.lower() in vowels:
            # Substitute vowel with * character
            letter = '*'
            # Keep track of how many vowels were substituted
            counter += 1
        # Create new string including substituted vowles
        new_string.append(letter)

    # Combine list of unicode characters in new_string back into a single string
    # By default will return a Tuple when more than 1 element is specified
    return ''.join(new_string), counter


x = strip_vowels(text)
print(x)
