Jun-25-2018, 07:59 AM
from string import punctuation def find_words(phrase, control): phrase = phrase.lower().split() words = [word.rstrip(punctuation) for word in phrase if word[0] < control] return words my_phrase = "My pet is a Tiger; wild, white and with big eyes. Don't touch him." print(find_words(phrase=my_phrase, control='n'))
['my', 'is', 'a', 'and', 'big', 'eyes', "don't", 'him']
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs