Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Klemens Meyer
5,656 PointsI have no idea what is wrong. Code works fine in workspaces. Can anybody help me , please ?
def find_words(count, data): list1=[] list2 =[] count = int(count) list1 = re.findall(r'\w+', data) for item in list1 : if len(item) >= count : list2.append(item) list2.insert(0,count) print(list2)
import re
# EXAMPLE:
# >>> find_words(4, "dog, cat, baby, balloon, me")
# ['baby', 'balloon']
def find_words(count, data):
list1=[]
list2 =[]
count = int(count)
list1 = re.findall(r'\w+', data)
for item in list1 :
if len(item) >= count :
list2.append(item)
list2.insert(0,count)
print(list2)
3 Answers

Megan Amendola
Treehouse TeacherHi! The challenge is asking you to return the list not print it. Also, it only wants the words, but you've inserted the count at the beginning of the list which is also causing an issue.
def find_words(count, data):
list1=[]
list2 =[]
count = int(count)
list1 = re.findall(r'\w+', data)
for item in list1 :
if len(item) >= count :
list2.append(item)
# list2.insert(0,count)
# print(list2)
return list2

Klemens Meyer
5,656 PointsExample shows count at the beginning of the list that's why I inserted it there . Thank you very much for help . :)

Megan Amendola
Treehouse TeacherAh, I see! Let me break that down for you:
# EXAMPLE:
# This part of the example is showing the function call to show you an example
# of the info your function will be receiving
# >>> find_words(4, "dog, cat, baby, balloon, me")
# This is the output from the function, or what your function should return
# ['baby', 'balloon']

Klemens Meyer
5,656 PointsAll right, i got it now . Thanks for explanation . :)
Klemens Meyer
5,656 PointsKlemens Meyer
5,656 Pointsshould be string in place of data, but this don't fix problem.