How can I search through a variable and look for a word/string that is greater than 20 in length?
var = '''this is my example and I want
no find the following
from this variable'''
Using a list comprehension:
print [x for x in var.split() if len(x) > 20]