Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialpeter backlund
6,910 PointsSometime's the compiler can't find my function even though it's named correctly. What gives?
I keep getting the error "Where's word_count()
?" Here's my code.
def word_count(str_some):
str_some = str_some.lower()
arr_some = str_some.split()
for idx in arr_some:
if idx in dict_let:
dict_let[idx] += 1
else:
dict_let[idx] = 1
return dict_let
1 Answer
Kenneth Love
Treehouse Guest TeacherWhere's dict_let
?
If there's a problem in the function, often the compiler can't find it because it wasn't successfully added to the registry.
peter backlund
6,910 Pointspeter backlund
6,910 PointsThanks for the speedy answer! I initialized dict_let and it worked. It can be kind of frustrating when the error doesn't give you any useful information, and it's especially difficult to troubleshoot errors in the code challenges. At least I know I can come back to the forum!