On 10/6/2016 10:15 AM, Zeel Solanki wrote:
def filter_long_words(words, n):
for x in words.split():
return filter(lambda x: len(x) > n, words)
print filter_long_words(raw_input("Enter a list of words with spaces in
between."), raw_input("Enter a number."))
raw_input() always returns a string. When you enter a number (say, 5) it
will be a string ("5").
use int() to convert that string to numeric.
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor