Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PYTHON 1. write a program that asks user to enter a word (any sequence of charac

ID: 3904371 • Letter: P

Question

PYTHON

1. write a program that asks user to enter a word (any sequence of characters)

2. put your program in file repeatingVowels.py

3. if no vowel appears next to itself (e.g. hello), then print:
no vowel repeats

4. if exactly one vowel is repeated in sequence at least once (e.g. committee) then print a message that indicates which vowel repeats:
only vowel e repeats

5. if more than one vowel repeats (e.g. green door) then print:
more than one vowel repeats

6. ignore upper case - lower case differences: assume all the input is always lowercase

EXAMPLE:

Example:

Example:

Explanation / Answer

vowels = [] word = input('enter word: ') for i in range(len(word) - 1): if word[i].lower() in 'aeiou' and word[i+1].lower() in 'aeiou' and word[i] == word[i+1]: vowel = word[i] if word[i] not in vowels: vowels.append(word[i]) if len(vowels) == 0: print('no vowel repeats') elif len(vowels) == 1: print('only vowel ' + vowels[0] + ' repeats') else: print('more than one vowel repeats')