Trying to take a string of tags and only save the first 10 that only have less than 2 words. Don’t know if this code is the right direction or not…
mystring = 'one, two, three, three three three, four four four, five, six'
for text in mystring:
number = len(mystring.split())
if text >= 2:
print number
basically want to output:
one, two three, five, six
“The result of removing whitespace from either end, of each of those items resulting from splitting mystring on commas, which produces less than two sub-items if split on whitespace”.