Solution Exercise 4

Write a program that takes a character (i.e. a string of length 1) and tells the user if the character is a vowel or not.

def main():
    vowels = "aeiouy"
    char = input("Enter a character:")
    # Make sure that the character that is passed in
    # is lower case so it can be found in the
    # vowels string
    if char.lower() in vowels:
        print(char, "is a vowel")
    else:
        print(char, "is not a vowel")

if __name__ == '__main__':
    main()