Python: Given a list of words, remove those with more than four characters?
Help answer this question:
def remove_long_words(words):
"""Given a list of words, remove any that are longer
than four letters and return a new, shorter list.
>>> w = ['ten', 'one', 'seven', 'nine', 'fifteen']
>>> remove_long_words(w)
['ten', 'one', 'nine']
>>> w = ['fifteen']
>>> remove_long_words(w)
[]
>>> w = ['ten', 'one', 'nine', 'six']
>>> remove_long_words(w)
['ten', 'one', 'nine', 'six']
>>> remove_long_words(['ten']) == ['ten']
True
"""
(replace this line with your code)
Click on show more to see the code.