S = "Now I need a drink, alcoholic of course after"\
    "the heavy lectures involving quantum mechanics."

S = S.replace('.', '').replace(',', '')

words = [s for s in S.split(" ")]
out = [len(word) for word in words]
print(out)