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

Python Tech Degree problem with Lists - Append Method

I got the following error when reviewing the video and working with workspaces. The Append Method is not working:

treehouse:~/workspace$ python
Python 3.5.0 (default, Apr 13 2017, 18:07:59)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.

my_list = {1, 2, 3, 4, 5}
my_list.append(6)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'set' object has no attribute 'append'

1 Answer

I am sorry. I confused { } with []

Everything is ok now.

Thank you

Andrew