Hi Guys, I've written a script to remove vowels from a string/sentence.
the while loop I'm using below is to take care of duplicate vowels found in a sentence, ie anti_vowel('The cow moos louder than the frog') It works, but obviously its messy and n00by. Any suggestions on how I can write this code better? ---- def anti_vowel(text): vowel = ['a', 'e', 'i', 'o', 'u'] VOWEL = ['A', 'E', 'I', 'O', 'U'] manip = [] for i in text: manip.append(i) fufu = 0 # while fufu < 16: for x in vowel: if x in manip: manip.remove(x) for y in VOWEL: if y in manip: manip.remove(y) fufu = fufu + 2 strong = ''.join(manip) return strong ---- Thanks - Vusa _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor