str1 = []
x = sentence.lower()
x = x.strip('.')
x = x.strip('!')
lsent = x.split()
for e in lsent:
if e != 'the' and e != 'is' and e != 'if' and e != 'it':
str1 = str1.append(e)
str1 = " ".join(str1)
print(str1)
Heres my code. When I try to append an item to the end of the list it tells me str1 is a nonetype object even though I made it a list in the first row.
Any help is appreciated I'm thoroughly confused.