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 trialGerald Wells
12,763 PointsCreate a new function names just_right that takes a single argument, a string. PYTHON help please
this is my code can someone tell me what I am doing wrong, I have run it in my terminal and everything is working as it should but for some reason I can not pass this challenge.
1 Answer
Chris Freeman
Treehouse Moderator 68,441 PointsYour code is very close. You need to use return
instead of print
for the strings.
Gerald Wells
12,763 PointsThank you Chris!
Chris Freeman
Treehouse Moderator 68,441 PointsThank you! For giving me my 600th Best Answer!!
Joseph Torkaman
1,019 PointsWhy is this the case?
Chris Freeman
Treehouse Moderator 68,441 Pointsprint
is used to display text on a console or STDOUT. This output text is not accessible by other code.
return
is a built-in command that returns an object pointer to the calling code.
The challenge checker calls the function and inspects the returned object for correctness.
If a function does not have an explicit return
statement then an implicit default is used:
return None
So without the return
the checker sees None
Gerald Wells
12,763 PointsGerald Wells
12,763 Points[MOD: added ```python markdown formatting -cf]