1# Say you have the array ['', 'foo', '.', 'bar', 'foo', '', 'bar']
2# and you want to remove the empty characters and periods. You do:
3
4tokens = filter(isImportant, array)
5
6for token in tokens:
7 print(token)
8
9# prints:
10# > foo
11# > bar
12# > foo
13# > bar
14
15def isImportant(token):
16 if token == '' or token == '.':
17 return False
18 return True
19
20