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 trialNancy Melucci
Courses Plus Student 36,143 PointsNeed some feedback. Why doesn't this work?
The "Bummer. Try again" response tells me nothing about how to fix this so I can get past the exercise. I really wish it would at least provide a hint. I hope someone will respond. I understand the principles here, so it's frustrating to be stuck on something that is apparently very simple.
import os
def absolute(path, root):
if os.path.isabs(path) == False
path.prepend(root)
return path
3 Answers
Steven Parker
231,236 PointsHere's a few hints:
- "if" statements should end with a colon (":")
- strings don't have a "prepend" method (you might try using concatenation with the "+" operator)
- strings are immutable and string operations must be assigned to a variable to be retained
Nancy Melucci
Courses Plus Student 36,143 PointsCrap. I left the colon off. That was all it was. I've been working with multiple languages and these things occasionally get past me. Thanks for the help. D'oh.
Steven Parker
231,236 PointsWait .. that "prepend" method works?
Nancy Melucci
Courses Plus Student 36,143 PointsNo sorry. I changed that too. It didn't notice that the site started me on step 1 of 2. I changed the prepend to concatenation to pass Step 2.
Steven Parker
231,236 PointsThought maybe they'd snuck in a new method on me for a moment.