Re: [Tutor] failed filter result

2015-04-06 Thread Alan Gauld
On 06/04/15 15:05, Jim Mooney wrote: Why did this fail where it did? It failed at listing the result of the filter of a word list, but I figured if it failed, it would have done so at the filter. words = open('5desk.txt').readlines() k = [word.rstrip for word in words] Notice that you are not

Re: [Tutor] failed filter result

2015-04-06 Thread Timo
Op 06-04-15 om 16:05 schreef Jim Mooney: Why did this fail where it did? It failed at listing the result of the filter of a word list, but I figured if it failed, it would have done so at the filter. words = open('5desk.txt').readlines() k = [word.rstrip for word in words] Your problem is in t

[Tutor] failed filter result

2015-04-06 Thread Jim Mooney
Why did this fail where it did? It failed at listing the result of the filter of a word list, but I figured if it failed, it would have done so at the filter. >>> words = open('5desk.txt').readlines() >>> k = [word.rstrip for word in words] >>> len(k) 61406 >>> p = filter(lambda word: len(word) >