Welcome to the Treehouse Community
Looking to learn something new?
Rabih Atallah3,405 Points
PLease how can I fix my code? help is much appreciated
import re # EXAMPLE: # >>> find_words(4, "dog, cat, baby, balloon, me") # ['baby', 'balloon'] def find_words(nb, string2): string2.split() L =  for e in string2.split(): if len(e) >= nb: L.append(e) return L
Chris FreemanTreehouse Moderator 67,989 Points
First hint is some of the items in the string are adjacent to a comma, so splitting with the default
split() leaves words like "match,"
Second hint is this is an
re challenge so you'll likely need to use an 're.search' or 're.match' to find the correct solution to look for words of
nb or longer actual characters:
string2.split() isn't assigned to a variable so it's output is thrown away. The line could be deleted.