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 trialDevan Laton
602 PointsIs what i'm trying to do changing the tuple?
I know this is really simple but I'm a little confused as to what I'm supposed to do. I imagine that I'm trying to change to tuple which I know can't be done, but I'm not sure as to what I'm supposed to do to make this work the way it's supposed to.
my_tuple = ('I', 'love', 'python',)
item3 = my_tuple(2)
1 Answer
devvoyage
Front End Web Development Techdegree Student 15,200 PointsHi there, Devan Laton! Trust me when I say that you're doing a lot better than you think! Your code is only faulty by a single character. And no, you're not changing the tuple. Rather, you're creating a new variable named item3
then assigning it the third value in that tuple. And you've done so brilliantly!
The error actually lies in the tuple
itself. You simply have an extra comma after 'python'
. Erase that comma and your code should pass just beautifully!
Hope this helps!
Devan Laton
602 PointsDevan Laton
602 PointsThank you for your help but when i tried doing that its giving me this error. "TypeError: 'tuple' object is not callable" I tried removing the quotation marks just to see if that was the problem but its not. also there aren't any hints for this challenge, although i could be wrong.
devvoyage
Front End Web Development Techdegree Student 15,200 Pointsdevvoyage
Front End Web Development Techdegree Student 15,200 PointsDevan Laton I wish I knew what your code looks like now. But the answer should have been to just remove a comma.
You had:
And it wanted:
If that doesn't work, you may need to restart the challenge. There could be something in your browser's cache that is interfering in some way.
Devan Laton
602 PointsDevan Laton
602 PointsI'm not sure what the problem is. I've gone back and changed it on here multiple times to what you told me, I tried restarting the challenge like you said and that didn't work either, and then i even went on my phone and tried to do it and that didn't work. So im not sure what i can do but i'll try to figure it out. If you have anything else to tell me than that would be greatly appreciated