alphabet_dic = ['a','b','c','d','e','f','g','h','i','j','k','l','n','o','p','q','r','s','t','u','v','w','y','z','m']
doc = Document('test3.docx')
firstSen = doc.paragraphs[0].text
print (firstSen)
indexLetters = 0
while indexLetters < len(c_dic):
d_dic = c_dic[indexLetters]
indexLetters += 1
secondSen = firstSen.replace(d_dic,"")
print (secondSen)
The test document holds the sentence "Hello There". I am attempting to make a loop in where it checks the dictionary for a long range of specific letters and slowly loops and remove the letters from "Hello There".
Idea:
Sentence = Hello There
helloDic = ['h','e','l','o']
Desire Result = Tr
Any suggestions or better way to do this?