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

Hello Does anyone know why my_tuple is incorect?

Hello Can any one know why my syntax for this task (writing tuples) is in correct item3= (10,) my_tuple= ('I', 'love', item3)

creating_tuples.py
item3= (10,);
my_tuple= ('I', 'love', item3);

1 Answer

rydavim
rydavim
18,813 Points

The wording of the challenge is a little bit confusing. It's nothing specifically wrong with your syntax, so much as the goal of the challenge step. English as a language has some ambiguity problems.

Create a variable called item3 and assign to it the third element in my_tuple.

This phrasing is admittedly not great, but what they want you to do is take your original answer to Part 1 and assign a new variable to refer to the third element.

my_tuple = ('I', 'love', 'python') # From Part 1
item3 = # The third element in the above tuple. (python)

Hopefully that helps clarify things, but if you still find yourself stuck let me know and we can walk through a solution. Happy coding!

Veronica Sharkey
Veronica Sharkey
2,577 Points

Thanks! I was stuck on the same thing -- thanks for clarifying. :)

Manuel Canario
Manuel Canario
1,458 Points

@rydavim

my_tuple[2] = item3 , the check tells me that the variable is not being defined.

rydavim
rydavim
18,813 Points

Manuel Canario - Generally if you run into your own issues with a challenge, it's best to start a new question so other students can weigh in or find information if they encounter a similar problem.

However, it looks like a simple order problem. You want to be assigning the value to item 3. Swap your answer 'round and that should correct your error. If that doesn't fix it, go ahead and post a new question and we can troubleshoot more in-depth.