# Define the name we use for the file containing the text
TEXTFILE = "q13.txt"
# For the dictionary we'll use a global variable
vowelcount = {}
# Read the text
try:
f = open(TEXTFILE)
contents = f.read()
f.close()
except FileNotFoundError:
print("Cannot open file: " + TEXTFILE)
exit()
# Lowercase the text so we need only check for 'a', 'e', 'i', 'o' and 'u'
contents = contents.lower()
# Initialise the dictionary
vowelcount["a"] = 0
vowelcount["e"] = 0
vowelcount["i"] = 0