Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
216,121 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
216,121 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"