[](https://drive.google.com/uc?export=view&id=18mZ3UeW9hXZqOZA-7NDE1r9qK46-R6l- โhello there(:โ {width=256 height=342})
import argparse
def make_word_bank(source, sep = ' '):
= []
word_list = ''
cur_word for letter in source:
if cur_word in word_list: #if word is already in word bank, skip it
= ''
cur_word continue
elif (letter != sep and letter not in '?!.,:;[]()"' and letter != '\n'): #if the string pulled is not the seperator, punctuations, or a new line, add it
+= letter
cur_word elif ((letter == sep or letter =='\n') and cur_word !=''): #this line ensures that cur_word is empty when new string is added to it
+= [cur_word]
word_list= ''
cur_word elif cur_word !='': #this adds the word being built into the word bank
+=[cur_word]
word_list= ''
cur_word if cur_word not in word_list: #this line deals with the very last set of letters the script pulls; if it's not in word bank already, it adds it
+=[cur_word]
word_listreturn word_list
if __name__ == "__main__":
# Create an ArgumentParser class object for dealing with commandline args
= argparse.ArgumentParser(
p ="Creates a word bank of all unique words in inserted sentence.")
description
= p.parse_args()
args
= input('what sentence do you want a word bank for? ')
source print (make_word_bank(source))