Jan-13-2019, 06:46 PM
Here are some of the things that were incorrect:
I didn't finish, but this will get you started
from random import randrange lista2 = [] a = True # Set word to empty string word = '' i = 0 # made get_word a function as it needs to be called several times def get_word(): while word == '': # don't need i here # i=i+1 # indentation was off on next line, added space after :, # added lower here rather than later, added spaces between operators b = input('give a word: ').lower() # following can be done better and needs to be redirected to run again: # if b == ('',' ',''): # print('one word only.') word = b.split() if len(word) > 1: print('one word only.') # Set word back to '' so loop continues word = '' print('the word has been given') return word # lista2.append(b) # b.lower() # if b==lista2[i]: # if b=='end': # break # word==word+1 # if word<5: # print('very short number of words') # print(b) # print (word) # print (lista2)This will allow you to call get_word as many times as needed.
I didn't finish, but this will get you started