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

Enrica Fedeli-Jaques
Enrica Fedeli-Jaques
6,773 Points

what do "to be on strings" and "to be on lists" mean

Hi, I don't understand what the two mean. And what it means that we look for the method in a place or the other? thanks a lot!

Steven Parker
Steven Parker
229,005 Points

It would help to see what context these phrases are used in. Can you provide a link to the course page, and time indexes if they are in a video?

2 Answers

Enrica Fedeli-Jaques
Enrica Fedeli-Jaques
6,773 Points

Hi Steven, thank you for your reply. the video is https://teamtreehouse.com/library/split-and-join and the minute 3.30 . apologies I thought the question was posted under the video and was self-explanatory :)

Steven Parker
Steven Parker
229,005 Points

I saw the question while browsing the forum, odd that it didn't create a link button to the video since it listed it on the video.

But what he's talking about the objects that certain methods belong to. When he says "to be on strings", he means the method ("join" in this case) is a string method. So when using the "dot" syntax you would apply this method to a string. A method "on lists" would be one that you would apply with dot syntax to a list.

Examples:

", ".join(names)  # the "join" method is used "on strings"
names.sort()      # and the "sort" method is used "on lists"