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

Christian Rowden
Christian Rowden
2,278 Points

slices.py question

Soo... I think I know what's going on here but need a little push in the right direction.

z = [1, 2, 3, 4, 5]

print(z[1::2]) print(z[-1::-2])

This code has the output of:

treehouse:~/workspace$ python pop.py [2, 4] [5, 3, 1]

So I've been trying to come up with the reason that it isn't working in the challenge and the only thing that I can think of is that I'm assuming the list in the challenge because I can't actually see it.... Can someone please point me straight?

Thank you

Elad Ohana
Elad Ohana
24,456 Points

Hi Christian,

Can you link to the challenge? Not sure what the objective is.

Thanks.