My skeleton looks like this
def convertWord(aWord):
# define vowels
vowel = "aeiouAEIOU"
pigWord = ""
beginsWithVowel = aWord[0] in vowel
hasPunctuation = not aWord[-1].isalnum()
if vowel==[0]:
aWord+=[0]+'yay'
else:
aWord+='ay'
return pigWord
# end convertWord
My book says to use slicing and create a string of vowels with 'aeiou'.
I have tried several problems. My main issue is getting the text from my document (we'll call it 'Text.txt') to convert each word.
I used
if vowel==[0]:
aWord=[0]+'yay'
else:
aWord+='ay'
My Python program says "working...."
But the output file has nothing. None of my exercises showed me how to exactly bring in text from another document and process it and my professor lightly touched on it.

New Topic/Question
Reply



MultiQuote




|