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 Basics (2015) Python Data Types Splitting and Joining

Why do I get an Attribute Error when I try to split a string in the workspace?

This is what my workspace looks like:

['hello there students'].split()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'split'

1 Answer

Steven Parker
Steven Parker
229,783 Points

The "split" method works on strings, but you're trying to use it on a list.

Now there's a string in that list, so if those brackets weren't there it would work.