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 trial

Python Introducing Tuples Getting to Know Tuples Creating Tuples

Sarah Schaeffer
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Sarah Schaeffer
Data Analysis Techdegree Graduate 11,564 Points

Tuples 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!

create_tuple.py
# insert your code here
def my_tuple():
    my_tuple = ('I', 'love', 'python')
    item3= my_tuple[2]

1 Answer

Asher Orr
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Asher Orr
Python Development Techdegree Graduate 9,410 Points

Hi 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!