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 trialSarah Schaeffer
Data Analysis Techdegree Graduate 11,564 PointsTuples Challenge task 2 of 2
Im not sure why I am getting the error item3 has not been set. Not sure what that means. Please help and thank you in advance!
# insert your code here
def my_tuple():
my_tuple = ('I', 'love', 'python')
item3= my_tuple[2]
1 Answer
Asher Orr
Python Development Techdegree Graduate 9,408 PointsHi Sarah! I'll tell you why:
Challenge 1 asks for only a variable called my_tuple. In your code, the variable is nested within a function. It's confusing the checker.
def my_tuple():
#delete the line above
my_tuple = ('I', 'love', 'python')
# then de-indent the line above (and the line below)
item3= my_tuple[2]
Try making those changes. Let me know if you have questions!
Sarah Schaeffer
Data Analysis Techdegree Graduate 11,564 PointsSarah Schaeffer
Data Analysis Techdegree Graduate 11,564 PointsThank. you so much Asher Orr, it worked!
Asher Orr
Python Development Techdegree Graduate 9,408 PointsAsher Orr
Python Development Techdegree Graduate 9,408 PointsThanks for letting me know, Sarah! Don't forget to click "Best Answer." That way, other people know you've been helped.