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 trialMolly Stieber
551 PointsI don't understand why my code doesn't work
I'm getting either the error that says that it didn't give the right answer or it takes 0 positional arguments but one was given and I don't know how to fix it.
def just_right(word):
word=[]
if len(word) > 5:
return("Your string is too long")
elif len(word) < 5:
return("Your string is too short")
else:
True
1 Answer
Jason Anders
Treehouse Moderator 145,860 PointsHi Molly,
You've pretty much got it... just two small things:
- The method takes a string as a argument, but for some reason you are taking that string being passed in and re-assigning it an empty dictionary? I'm not sure where you got that from, so line 2 just needs to be deleted.
- In your
else
clause, you are missing thereturn
keyword needed to returnTrue
.
Once those two things are taken care off, the rest of the code looks great and will pass!
Keep Coding! :)