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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Duc Kevin Nguyen](https://secure.gravatar.com/avatar/eac712c78b2d7c2b065928c4fcce52b3?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Duc Kevin Nguyen
1,566 Pointswhy this doesn't work??
i think it's right, but it's no. how ?
favorite_things = ['raindrops on roses', 'whiskers on kittens', 'bright copper kettles',
'warm woolen mittens', 'bright paper packages tied up with string',]
slice1 = favorite_things[1:4]
slice2 = favorite_things[5:]
2 Answers
![Phil Baker](https://secure.gravatar.com/avatar/dee2d47f70966a040361f889e993f0b2?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Phil Baker
27,352 Pointslooking at that I think your code is correct but favorite_things
is missing a couple of items:
favorite_things = ['raindrops on roses', 'whiskers on kittens', 'bright copper kettles',
'warm woolen mittens', 'bright paper packages tied up with string',
'cream colored ponies', 'crisp apple strudels']
slice1 = favorite_things[1:4]
slice2 = favorite_things[5:]
![Mark Chesney](https://uploads.teamtreehouse.com/production/profile-photos/10045392/micro_1.jpg)
Mark Chesney
11,747 PointsHi Duc Kevin Nguyen,
Looks like you're on the task 2 of 3.
Task 2 asks for the last 2 elements of the list. If I want to store the last five elements, I put a negative value before the colon (:
) symbol. Example:
last_five = favorite_things[-5:]
In this example there are few enough to count, but if you needed the last 440 entries of a list that's very long, you can do this: list_xyz[-440:]
Hope this helps!
Steven Parker
230,688 PointsSteven Parker
230,688 PointsPhil Baker — you should post this as an answer instead of a comment, so can can receive votes ans possibly a "best answer" from Duc. If I were a moderator, I would promote it to an answer for you.