I am reading in a string of words and trying to retrieve all the vowels in them but not having much success. so if I have this: Hello this is a test this is. I want to return something like this:
:|eo| 1 :|
:|i | 1 :|
:|i | 1 :|
:|a | 1 :|
:|i | 1 :|
:|i | 1 :|
Here is the latest version of my code which just prints the word, I know I need to loop through each word but can't figure out how without it turning into an endless loop.
import sys
import re
import string
line = sys.stdin.readline()
vowels = ['a', 'e', 'i', 'o', 'u']
line = line.lower()
line = line.replace(',', ' ').replace(';',' ').replace('”','').replace('?', .').replace('!','.')
word = line.split()
print(word)
line = sys.stdin.readline()
question from:
https://stackoverflow.com/questions/66057534/python-extract-vowels-from-words 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…