Can anyone explain what check is being performed on word in the statement if word: in the following code?
def simplify(text, space=" \t\n\r\f", delete=""):
result = []
word = ""
for char in text:
if char in delete:
continue
elif char in space:
if word:
result.append(word)
word = ""
else:
word += char
if word:
result.append(word)
return " ".join(result)
=+some cool new Python 3 thing or will that result in aTypeError?