Mar-13-2019, 11:54 PM
I think you should introduce a special flag, that will indicate beginning of a word. I began to write the code, but since this is an assignment, I pasted it partially:
import string words = input('Enter a series of words separated by spaces: ') print('The length of the input string is ',len(words)) current_word = '' container = [] for j in words: word_beginning_flag = j in string.ascii_letters # you can define string.ascii_letters manually instead if word_beginning_flag: current_word += j if j not in string.ascii_letters: word_beginning_flag = False # ....................